Commands For Unix/Linux Operating Systems and Their Syntax: Filesystem Informational Text Filtering / Mutative
Commands For Unix/Linux Operating Systems and Their Syntax: Filesystem Informational Text Filtering / Mutative
#nformational
cat [opts] [filepattern] Print file contents on S$%"$
-* -> -v :'isplay a = at the end o! each line. :"how ta s as ?I. :"how non-printing characters. date [opts] Print or set the system date and time --date3STRING :display time descri ed y STRING. --set3STRING :set time descri ed y STRING. dmesg [opts] Print or control the kernel ring &uffer -c :Clear the contents o! the ring u!!er. file [opts] [filepattern] 'etermine the file type -% :>ry to loo6 inside compressed !iles. finger [opts] [userpattern] Show info a&out system users -m :@atch the e+act username speci!ied. free [opts] 'isplay free and used memory in the system :'isplay the in!ormation in ytes. he(dump [opts] Show all the characters of a file -c :'isplay the input o!!set in he+idecimal last [opts] [username] Show last system logins for users -num :"how last num o! sessions. -a :'isplay the hostname in the last column. -d :>ranslates IP num ers to their hostname. -! <!ile> :;se !ile as last log. less [opts] [filepattern] )iew a file a page at a time -i :'o case insensitive searching. -" :'on.t wrap long lines. man [opts] [section] <manpage> )iew online manual pages. -a :<iew all availa le manual pages !or name. -6 string :"earch !or the speci!ied string. md*sum [opts] [filepattern] Show the uni+ueness of files ps [opts] Show what processes are running on the system a :"elect all processes on a terminal. u :'isplay user oriented !ormat. @ore columns. + :"elect processes without a controlling >>A. w :"how an e+tra line o! process entry per w. *+: ps au+www 3'isplays all process in!ormation on system. +uota [opts] [user] 'isplay disk usage and limits -v :'isplay !ilesystems where no Buota is set. time [opts] [command] Show resource usage for a command top [opts] 'isplay top CP" processes e ery , seconds -d sec :"et the delay to sec seconds e!ore re!reshing. umask [opts] [mode] Set the default file permissions -" :"how current sym olic umas6. uname [opts] Show %S and system information -a :"how everything uptime Show system uptime and load w [opts] [user] Show who is logged in/what they are doing whereis [command] Locate the related files for a command which [command] CShow full path to the specified command who [opts] [args] Show who is logged in
-etwork
ifconfig [devicename] [action] [options] ipchains [opts] Manip. ipchains firewall1kernel /./23 ipta&les [opts] Manip. ipta&les firewall1kernel /.423 mail [opts] [address] Send mail from the command line 8
7ash Shell
Send S$'%"$ to a file. o erwrite/create a file *+: ls -l > list-o!-!iles.t+t >new!ile 88 Send S$'%"$ to a file0 appending to te end of the file *+: ps au+ > pslog.t+t date >> pslog.t+t 9 Send the S$'%"$ from a command to the S$'#- of another *+: cat listo!names E sort cat accessDlog E aw6 F(print =1.G E sort E uniB /8 Send S$':!! to a file0 o erwriting the filename *+: start+ H> .errorlog alias Create a command alias in the shell *+: alias ls3.ls -la --color3auto. cd [-] [directory] Change the current working directory - :Change to the previous directory you were in. clear Clear the terminal display en [opts] [command] !un command in modified en ironment e(port [opts] [variable] :(port an en ironment aria&le *+: e+port >*R@ ;"*RXP@* P"1 @PI5"P&&5 e+port >*R@3vt1MM for :(ecute se+uence of commands for a list of items *+: !or i in K.mpI Z do mpg1HI =i Z done !or n in 1 H I 0 Z do m6dir =n Z done history Show the command history up til now nice [opts] [command] Set the %S process priority *+: nice 12 g%ip accessDlog 7lowest priority on 5inu+8 *+: nice -HM 6swapd 7real time priority on 5inu+8 pwd Print out the current working directory renice [opts] <arg> Change priority of a running process -p %I&: "peci!y a process id to renice *+: = ps au+w E grep g%ip 6319 ? S 0:20 gzip bigfile.txt = renice 12 -p /I12 reset #nitializes the terminal as if you ;ust logged in set Set a shell option or aria&le 1run <help set=3 sleep Pause for specified period &efore continuing *+: ps au+ Z sleep I/MM Z ps au+ umask Set the default file permissions *+: umas6 MHH 7!iles will e created /00 y de!ault.8 while > loop that runs commands while a condition is true *+: while 7true8 Z do ps au+w Z sleep 1m Z done > pslog (args [opts] [command] :(ecute a command for each arg -n number :#ow many arguments to give each command run. -p :Prompt the user e!ore each command is run. -d -g -[ -s
>dmin
adduser [opts] <username> >dd a user to the local system
<dir> : "et the home directory !or the user to dir. <group> : "et the primary group !or the user to group. <group4group4'> : "et additional groups !or the user. <shell> : "et the de!ault shell !or the user to shell. chfn Change the finger information for a user chsh Change the shell used for the user ed+uota [opts] <user> :dit a user=s or group=s +uota -g : *dit the group Buota instead o! user Buota. kill [-signal] <pid> $erminate a process/Send it a signal -#;P4-1 : "ignal usually ma6es process to reread con!ig. -2 :"end a "I[\I554 process must die. -l :Print a list o! signal names and num ers. killall [-signal] [name]?ill processes &y name -e :ReBuire an e+act name o! a process. -i :Interactively as6 !or con!irmation e!ore 6illing. ldd [opts] [program] Show a programs li&rary dependencies mount [opts] <device> [mountpoint] Mount a file system -o <opts> : "peci!y options !or mounting. 5isted elow.
loop remount ro4 rw user @ount a dis6 !ile such as a C'-R&@ image or !loppy image. Remount the !ilesystem with new options @ount !ilesystem in readonly or read-write mode. Pllow normal users to mount this !ilesystem.
-s sub ect :"peci!y the su Rect as sub ect. -c list :"end car on copy to list o! users. - list :"end lind car on copy to list o! users. *+: echo S@eet me at noon.T E mail -s SReminderT -c U o Vcompany.com4su%yVcompany.com Rac6Vcompany.com netstat [opts] Print network connections and info -a :"how oth listening and non-listening soc6ets. -n :'o not attempt to resolve IP addresses. -t :&nly show tcp soc6et connection ta le. ping [opts] [host] Send #CMP packets to network hosts -c count :"end count num er o! pac6ets and then Buit. -i sec :Wait sec seconds etween sending pac6ets. route [opts] [target] Show/Manipulate #P routing ta&le -n :"how numerical addresses instead o! hostnames. scp [opts] [[host!]fromfile] [[host!]to] Secure copy -C :Compresses the data that is sent over the session. -r :Recursively copy directories. ssh [opts] [[user"]host] [command] Secure shell/login -C :Compresses the data that is sent over the session. sniffit [opts] !ecord $CP network traffic -i :Interactive mode. "hows all tra!!ic. -l <length> :"et the ma+imum sni!! length to length. -p <port> :"peci!y the port num er on the target host. -s <source> :"et the source IP !rom which pac6ets come. -t <target> :"et the IP to which pac6ets are going. tcpdump [opts] [expression] 'ump traffic on a network telnet [opts] [host] [port] %pen $CP socket to a host -n <!ile> : &pens file !or recording trace in!ormation. -+ :>urns on encryption o! the data stream i! possi le. traceroute [opts] [host] Show the route packets take -n :'on.t do 'X" loo6ups o! the IP addresses. wget [opts] [#R$] Make a 5$$P re+uest from the shell -r :Recursive get the ;R5 and all it.s lin6s. -6 :Convert the non-relative lin6s to relative ones. whois [opts] <arg["server]> C6uery a whois data&ase *+: whois domain.com whois domain.comVwhois.networ6solutions.com whois 1HY.M.M.1Varin.net
-r :@ount the !ilesystem read-only. "ame as (-o ro. -t <vfstype> :"peci!y the type o! !ilesystem to mount.
e+tH4 e+tI v!at iso2//M n!s Xative 5inu+ partition types. Windows 2+ IH- it partition type. C'-R&@ !ilesystem. Xetwor6 remote !ilesystem.
Most commands accept the use of v, -h or help for displaying verbose information and help information. Commands and options displayed in red can only be used by the superuser (root).