UnixlLinux Command Ref erence F0SSwire.o,ccpweb.wustl.edu/pdfs/Unix_CommHelp2.pdf · lmkdir crjr -...
Transcript of UnixlLinux Command Ref erence F0SSwire.o,ccpweb.wustl.edu/pdfs/Unix_CommHelp2.pdf · lmkdir crjr -...
UnixlLinux Command Ref erence F0SSwire.o,"iWF:*lKd:ll ls - d i rectory l is t ing1s - a l - formatted l is t ing
I cd djr - change directoryrcd - change to home
ipwd - shor,v current dlrectoryrlmkdir cr j r - create a dlrectory dir
I rm f i le - deJete f le]rn - r d j r - delete directory dir
I rm - f f i le * force remove f i lej rm - r f d j r - force remove dlrectory dir *
jcp f i ie l f i le2 - coPY f i le1 to f i le2l .p - t d i r i d i r2 -copydir i to dir2;creaLedir2i f tL
doesn' t existlmv f j le l f i le2 - rename or move f i le l Lo f i le2
date - show the current date and t imecal - shornr th is month's calendarupt ime - short ' current uPt lmew - display rvho is onl inewhoami - who you are logged in as{ i noe r t !s.pr - d iSO]a., inf nrrnal ion ahnrr l USgr' : " jL,
urvP/uJ
uname -a - shorry kernel informat ioncaI / proc/ cpuinf o - cpu informat ioncat /proc/meminf o - memory infonnattonman connand - show the tr- ranual for commonddf - shor,r ' d isk usagedu - show directory space usagef ree - shorry memory and s\ \ raP usageurhereis app - show possibJe locat ions of oppwhich app - shorv which cpp iv i l l be run by defaul t
WWtar cf f i le. tar f i les - create a tar named
f i le. tor containing f lestar xf f j le. tar - extract the f i les f rorn f i le. tortar czf f i le. tar .gz t i les - create a tar wj th
Gzip compresstontar xzf f i le. tar .gz - ext"ract a tar using Czlptar c j t f i le. tar .bz2 - create a tarwi th Bztp2compressiontar x j t f i le. tar .bz2 - extract a tar using Bzip2gzip f i le - compresses r f i le and renames i t to
f i le.gzgzip -d f j ie. gz - decompresses f i le.gz back to
fi\e
whois danain - get whois informat ion for domoindig donain - get DNS informat jon for domorndig -x hcst - revetse lockuP hoslwget f i le - download f i lewget -c f j le - cont inue a stopped download
with hidden f i lesto dir
1if f i le2 is an exist ing directory, moves f i le l intoldirectorv f i1e2ln - s i i te t i rX - create symbol ic l ink l ink to f i Ietouch f i le - create or uPdate f /ecat > f j le - p laces standard input into f 1e
more f j I e - output the contents of f i lehead f j le - output the f i rst 10 l ines of f i letai t f j le - output the la.st 10 l jnes of f i letai t - l f i le - output the contents of f /e as i tqro\^/s, start ing wi th the last l0 l ines
ps - d isplay your current ly act ive processestop - d lsplay al l running processeski l l p id - k i i ) process id Pidki l la l1 proc - k i l l a l l processes named proc *
bg - l is ts stopped or background. lobs; resume a
stopped 3ob in the backgroundf g - br ings the most recent 3ob to foregroundtg n - bnngs3ob n to the foreground
chmod octal f j le - changeto octol . which can be foundgroup, and world by adding:
o 4-read(r)o 2-wri te(w)r 1-execute{x)
Examples:chmod 717 - read, wr i te, execute for a l l
chmod 755 - rurx for owner, rx for group and world
For more opt ions, see man chmod.
ssh user@host - connect to host as userssh - p port user@host - connect to host on portDOn as userssh- copy- id user@host - add your key to host foruser to enable a keyed or passwordless login
grep pattern f i les -grep -r pat tern dirDottern in dirconnand I grep pattern - search for pottern
output of commandlocate f i le - f ind
the permissions of f /eseparately for user,
Instal l f rom source:. /conf iguremakemake instal ldpkg - i pkg. deb -rpm -Uvh pkg.rpn
instal l a package (Debian)- instal l a package (RPM)
search for pottern in f i les- search recursivelY for
Ctrt+C - hal ts the current commandCtr l+Z - stops the current command, resume with
fg in the foreground or bg in the backgroundCtr l+D - log out of current sessjon, s lmi lar to exi t
Ctr t+W - erases one word in the current l ineCtr l+U - erases the whole l ineCtr l+R - type to br ing up a recent command| ! - repeats the last commandexi t - log out of current session
* use with extrenre caut ion. |JJf f i
p ing host - p ing host and output resul ts
ffiAlfil hre
instances of f i le
in the