UnixlLinux Command Ref erence F0SSwire.o,ccpweb.wustl.edu/pdfs/Unix_CommHelp2.pdf · lmkdir crjr -...

1
UnixlLinux Command Ref erence F0SSwire.o iWF:*lKd:l lls - directory listing 1s - al - formatted listing I cd djr - change directory rcd - change to home ipwd - shor,v current dlrectoryr lmkdir crjr - create a dlrectory dir I rm fi le - deJete f le ]rn - r djr - delete directory dir I rm - f f ile * force remove file j rm - rf djr - force remove dlrectory dir * jcp fiiel file2 - coPY file1 to file2 l.p -t diri dir2 -copydiri to dir2;creaLedir2if tL doesn't exist lmv fj lel f ile2 - rename or move filel Lo file2 date - show the current date and time cal - shornr this month's calendar uptime - short' current uPtlme w - display rvho is online whoami - who you are logged in as {i noe r t!s.pr - diSO]a., inf nrrnalion ahnrrl USgr ':"jL, urvP/uJ uname -a - shorry kernel information caI / proc/ cpuinf o - cpu information cat /proc/meminf o - memory infonnatton man connand - show the tr-ranual for commond df - shor,r' disk usage du - show directory space usage f ree - shorry memory and s\\raPusage urhereis app - show possibJe locations of opp which app - shorv which cpp ivill be run by default WW tar cf file.tar f iles - create a tar named file.tor containing f les tar xf fjle.tar - extract the files frorn file.tor tar czf f ile.tar.gz ti les - create a tar wjth Gzip compresston tar xzf f ile.tar.gz - ext"ract a tar using Czlp tar cjt file.tar.bz2 - create a tarwith Bztp2 compression tar xj t file.tar.bz2 - extract a tar using Bzip2 gzip f ile - compresses rfile and renames it to file.gz gzip -d fjie. gz - decompresses file.gz back to fi\e whois danain - get whois information for domoin dig donain - get DNS informatjon for domorn dig -x hcst - revetse lockuP hosl wget file - download file wget -c fjle - continue a stopped download with hidden files to dir 1if file2 is an existing directory, moves filel into ldirectorvfi1e2 ln - s iite tirX - createsymbolic link link to fiIe touch file - create or uPdate f/e cat > fjle - places standard input into f 1e more fj I e - output the contents of file head fj le - output the first 10 lines of file tait fj le - output the la.st 10 ljnes of file tait -l file - output the contents off/e as it qro\^/s, starting with the last l0lines ps - display your currently active processes top - dlsplay all running processes kill pid - kii) process id Pid killal1 proc - kill all processes named proc * bg - lists stopped or background.lobs; resume a stopped 3ob in the background f g - brings the most recent 3ob to foreground tg n - bnngs3ob n to the foreground chmod octal fjle - change to octol . which can be found group, and world by adding: o 4-read(r) o 2-write(w) r 1-execute{x) Examples: chmod 717 - read, write, execute for all chmod 755 - rurx for owner, rx for group and world For more options, see man chmod. ssh user@host - connect to host as user ssh - p port user@host - connect to host on port DOnas user ssh- copy-id user@host - add your key to host for user to enable a keyed or passwordless login grep pattern files - grep -r pattern dir Dottern in dir connand I grep pattern - search for pottern output of command locate file - find the permissions of f /e separately for user, Install from source: ./configure make make install dpkg - i pkg. deb - rpm -Uvh pkg.rpn install a package (Debian) - install a package (RPM) search for pottern in files - searchrecursivelY for Ctrt+C - halts the current command Ctrl+Z - stops the current command, resume with fg in the foreground or bg in the background Ctrl+D - log out of current sessjon, slmilar to exit Ctrt+W - erases one word in the current line Ctrl+U - erases the whole line Ctrl+R - type to bring up a recent command | ! - repeats the last command exit - log out of current session * use with extrenre caution. |JJffi ping host - ping host and output results ffi Alfil hre instances of file in the

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