LINUX的常用指令Word文档下载推荐.docx

上传人:b****6 文档编号:18908832 上传时间:2023-01-02 格式:DOCX 页数:18 大小:30.71KB
下载 相关 举报
LINUX的常用指令Word文档下载推荐.docx_第1页
第1页 / 共18页
LINUX的常用指令Word文档下载推荐.docx_第2页
第2页 / 共18页
LINUX的常用指令Word文档下载推荐.docx_第3页
第3页 / 共18页
LINUX的常用指令Word文档下载推荐.docx_第4页
第4页 / 共18页
LINUX的常用指令Word文档下载推荐.docx_第5页
第5页 / 共18页
点击查看更多>>
下载资源
资源描述

LINUX的常用指令Word文档下载推荐.docx

《LINUX的常用指令Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《LINUX的常用指令Word文档下载推荐.docx(18页珍藏版)》请在冰豆网上搜索。

LINUX的常用指令Word文档下载推荐.docx

Netscape,NETSCAPEandnEtscapearethreedifferentcommands.Alsomy_filE,my_file,andmy_FILEarethreedifferentfiles.Youruserloginnameandpasswordarealsocasesensitive.(ThisgoeswiththetraditionofUNIXandthe"

c"

programminglanguagebeingcasesensitive.)

2.Filenamescanbeupto256characterslongandcancontainletters,numbers,"

."

(dot),"

_"

(underscore),"

-"

(dash),plussomeothernotrecommendedcharacters.

3.Fileswithnamesstartingwith"

arenormallynotshownbythels(list)ordircommands.Thinkofthesefilesas"

hidden"

.Usels-a 

(listwiththeoption"

all"

)toseethesefiles.

4."

/"

isanequivalenttoDOS"

\"

(rootdirectory,meaningtheparentofallotherdirectories).

5.UnderLinux,alldirectoriesappearunderasingledirectorytree(therearenoDOS-styledriveletters).

6.Inaconfigurationfile,alinestartingwith#isacomment.

7.1Linuxessentialshortcutsandsanitycommands

Alt>

F1>

Switchtothefirsttextterminal.UnderLinuxyoucanhaveseveral(6instandardsetup)terminalsopenedatthesametime.

Fn>

(n=1..6)

Switchtothenthtextterminal.

tty

Printthenameoftheterminalinwhichyouaretypingthiscommand.

F7>

SwitchtothefirstGUIterminal(ifX-windowsisrunningonthisterminal).

 

(n=7..12)

SwitchtothenthGUIterminal(ifaGUIterminalisrunningonscreenn-1).Ondefault,nothingisrunningonterminals

8to12,butyoucanrunanotherserverthere.

(Inatextterminal)Autocompletethecommand 

ifthereisonlyoneoption,orelseshowalltheavailableoptions.

THISSHORTCUTISGREAT!

ItevenworksatLILOprompt!

ArrowUp>

Scrollandeditthecommandhistory.Press<

Enter>

toexecute.

Shift>

PgUp>

Scrollterminaloutputup.Workalsoattheloginprompt,soyoucanscrollthroughyourbootupmessages.

PgDown>

Scrollterminaloutputdown.

+>

(inX-windows)ChangetothenextX-serverresolution(ifyousetuptheX-servertomorethanoneresolution).FormultipleresolutionsonmystandardSVGAcard/monitor,Ihavethefollowinglineinthefile/etc/X11/XF86Config(thefirstresolutionstartsondefault,thelargestdeterminesthesizeofthe"

virtualscreen"

):

Modes"

1024x768"

"

800x600"

640x480"

512x384"

480x300"

400x300"

1152x864"

->

(inX-windows)ChangetothepreviousX-serverresolution.

BkSpc>

(inX-windows)KillthecurrentX-windowsserver.UseiftheX-windowsservercrushesandcannotbeexitednormally.

Del>

Shutdownthesystemandreboot.Thisisthenormalshutdowncommandforauseratthetext-modeconsole.Don'

tjustpressthe"

reset"

buttonforshutdown!

c

Killthecurrentprocess(mostlyinthetextmodeforsmallapplications).

d

Logoutfromthecurrentterminal. 

Seealsothenextcommand.

Send[End-of-File]tothecurrentprocess.Don'

tpressittwiceelseyoualsologout(seethepreviouscommand).

s

Stopthetransfertotheterminal.

q

Resumethetransfertotheterminal.Tryifyourterminalmysteriouslystopsresponding.

z

Sendthecurrentprocesstothebackground.

exit

Logout.Icanalsouselogoutforthesameeffect. 

(Ifyouhavestartedasecondshell,e.g.,usingbashthesecondshellwillbeexitedandyouwillbebackinthefirstshell,notloggedout.)

reset

Restoreascrewed-upterminal(aterminalshowingfunnycharacters)todefaultsetting.Useifyoutriedto"

cat"

abinaryfile.Youmaynotbeabletoseethecommandasyoutypeit.

MiddleMouseButton>

Pastethetextwhichiscurrentlyhighlightedsomewhereelse.Thisisthenormal"

copy-paste"

operationinLinux. 

(Itdoesn'

tworkwithNetscapeandWordPerfectwhichusetheMSWindows-style"

.Itdoesworkinthetextterminalifyouenabled"

gpm"

serviceusing"

setup"

.)BestusedwithaLinux-ready3-buttonmouse(Logitechorsimilar)orelseset"

3-mousebuttonemulation"

).

~

(tilde)Myhomedirectory(normallythedirectory/home/my_login_name).Forexample,thecommandcd~/my_dirwillchangemyworking 

directorytothesubdirectory"

my_dir"

undermyhomedirectory. 

Typingjust"

cd"

aloneisanequivalentofthecommand"

cd~"

.

(dot)Currentdirectory.Forexample,./my_programwillattempttoexecutethefile"

my_program"

locatedinyourcurrentworkingdirectory.

..

(twodots)Directoryparenttothecurrentone.Forexample,thecommandcd..willchangemycurrentworkingdirectoryoneonelevelup.

7.2CommonLinuxcommands--systeminfo

pwd

Printworkingdirectory,i.e.,displaythenameofmycurrentdirectoryonthescreen.

hostname

Printthenameofthelocalhost(themachineonwhichyouareworking).Usenetconf(asroot)tochangethenameofthemachine.

whoami

Printmyloginname.

idusername

Printuserid(uid)andhis/hergroupid(gid),effectiveid(ifdifferentthantherealid)andthesupplementarygroups.

date

Printorchangetheoperatingsystemdateandtime.E.g.,Icouldchangethedateandtimeto2000-12-3123:

57usingthiscommand:

date123123572000

Tosetthehardware(BIOS)clockfromthesystem(Linux)clock,usethecommand(asroot)setclock

time

Determinetheamountoftimethatittakesforaprocesstocomplete+otherinfo.Don'

tconfuseitwiththedatecommand.E.g.Icanfindouthowlongittakestodisplayadirectorycontentusing:

timels

who

Determinetheusersloggedonthemachine.

rwho-a

(=remotewho)Determineallusersloggedonyournetwork.Therwhoservicemustbeenabledforthiscommandtorun.Ifitisn'

t,runsetupasroottoenable"

rwho"

fingeruser_name

Systeminfoaboutauser.Try:

fingerroot

last

Showlistingofuserslastlogged-inonyoursystem.

history|more

Showthelast(1000orso)commandsexecutedfromthecommandlineonthecurrentaccount.The"

|more"

causesthedisplaytostopaftereachscreenful.

uptime

Showtheamountoftimesincethelastreboot.

ps

(=printstatus)Listtheprocessescurrentlyrunbythecurrentuser.

psaxu|more

Listalltheprocessescurrentlyrunning,eventhosewithoutthecontrollingterminal,togetherwiththenameoftheuserthatownseachprocess.

top

Keeplistingthecurrentlyrunningprocesses,sortedbycpuusage(topusersfirst).InKDE,youcangetGUI-basedKtopfrom"

K"

menuunder"

System"

TaskManager"

(orbyexecuting"

ktop"

inanX-terminal).

uname-a

(=Unixnamewithoption"

)Infoonyour(local)server.Icanalsouseguname(inX-windowterminal)todisplaytheinfomorenicely.

free

Memoryinfo(inkilobytes).

df-h

(=diskfree)Printdiskinfoaboutallthefilesystems(inhuman-readableform)

du/-bh|more

(=diskusage)Printdetaileddiskusageforeachsubdirectorystartingatthe"

(root)directory(inhumanlegibleform).

cat/proc/cpuinfo

Cpuinfo--itshowthecontentofthefilecpuinfo.Notethatthefilesinthe/procdirectoryarenotrealfiles--theyarehookstolookatinformationavailabletothekernel.

cat/proc/interrupts

Listtheinterruptsinuse.

cat/proc/version

Linuxversionandotherinfo

cat/proc/filesystems

Showthetypesoffilesystemscurrentlyinuse.

cat/etc/printcap

Showthesetupofprinters.

lsmod

(Asroot.Use/sbin/lsmodtoexecutethiscommandwhenyouareanon-rootuser.)Showthekernelmodulescurrentlyloaded.

set|more

Showthecurrentuserenvironment.

echo$PATH

Showthecontentoftheenvironmentvariable"

PATH"

.Thiscommandcanbeusedtoshowotherenvironmentvariablesaswell.Use"

set"

toseethefullenvironment.

dmesg|less

Printkernelmessages(thecontentoftheso-calledkernelringbuffer).Press"

q"

toquit"

less"

.Useless/var/log/dmesg 

toseewhat"

dmesg"

dumpedintothisfilerightafterthelastsystembootup.

7.3Basicoperations

any_command--help|more

Displayabriefhelponacommand(workswithmostcommands)."

--help"

workssimilartoDOS"

/h"

switch.The"

more"

pipeisneedediftheoutputislongerthanonescreen.

mantopic

Displaythecontentsofthesystemmanualpages(help)onthetopic.Trymanmanfirst.Press"

toquittheviewer.Thecommandinfotopicworkssimilarandmaycontainmoreup-to-dateinformation.Manualpagescanbehardtoread.Tryany_command--helpforshort,easytodigesthelponacommand.Ifmoreinfoneeded,havealooktothedirectory/usr/doc.Todisplaymanualpagefromaspecificsection,Imayusesomethinglikeinthisexample:

man3exit(thisdisplaysaninfoonthecommandexitfromsection3ofthemanualpages).

apropostopic

Givemethelistofthecommandsthathavesomethingtotodowithmytopic.

helpcommand

Displaybriefinfoonabash(shell)build-incommand.

ls

Listthecontentofthecurrentdirect

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 自然科学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1