| Linux and Unix Command Reference Summary | HomePage | ||
| Powered by Webelink.com   | # | Command | Type | Description |
| 1. | id | admin | Show your login information |
| 2. | id joe | admin | Show login information for user joe |
| 3. | last | admin | Show listing of all users last logged into the system. |
| 4. | uptime | admin | Show how long the system has been running since last reboot. |
| 5. | history | pg | admin | Show the last several hundred commands executed from the command line on the current account |
| 6. | cat /proc/version | admin | Show the contents of a text file.This example show Linux version info. |
| 7. | cat /etc/lsb-release | admin | Show the Linux version info on Debian or Ubuntu Linux. |
| 8. | lsb_release -d -s -c | admin | Show the Linux version info on Debian or Ubuntu Linux. |
| 9. | cat /proc/cpuinfo | admin | Show CPU info |
| 10. | file /tmp/test.file | admin | Shows file type for file "/tmp/test.file", such as text, tar, script, ascii text or executable. |
| 11. | alias | admin-alias | List all shortcut alias commands defined as an alias. |
| 12. | alias home='cd /home/joe/libs' | admin-alias | Create a shortcut named "home" which will put you in a directory named "/home/joe/libs" whenever a user types "home" from a command prompt. |
| 13. | alias ll='ls -lia' | admin-alias | Create a shortcut named "ll" to run the command "ls -lia" whenever a user types "ll" from a command prompt. |
| 14. | di -a | admin-di | Display all mounted file systems. The "-a" option shows all file systems including ones with 0 total blocks. |
| 15. | di -m | admin-di | Display all mounted file systems. The "-m" option shows all file systems with file sizes in megabytes. |
| 16. | finger | admin-finger | Show all active system users. |
| 17. | finger -lmsp | admin-finger | Show detailed information on all active users. |
| 18. | finger joe | admin-finger | System info about user "joe" |
| 19. | fuser -u VOC | admin-fuser | Show all process IDs using the file "VOC". (May be a restricted Command for non-admins) |
| 20. | fuser -u /dev/rmt0 | admin-fuser | Show all process IDs using the tape drive device "/dev/rmt0" |
| 21. | ioscan | admin-ioscan | Show all hardware devices. |
| 22. | ioscan -funC tape | admin-ioscan | Show all hardware devices assigned for tape drives. |
| 23. | ioscan -funC disk | admin-ioscan | Show all hardware devices assigned for disk drives. |
| 24. | kill -9 7777 | admin-kill | Kill process with a PID or Process ID of 7777. The "-9" option is a forced kill. |
| 25. | kill -9 7777 5555 4444 | admin-kill | Kill multiple processes with a Process ID of 7777, 5555 and 4444. The "-9" option is a forced kill. |
| 26. | ln -s /usr/joe/db /joe/db | admin-links | Create a symbolic link for /joe/db to point to /usr/joe/db. |
| 27. | unlink /joe/db | admin-links | Delete symbolic link /joe/db. |
| 28. | ln -s tmp joe | admin-links | Create a symbolic link for joe to point to tmp directory. |
| 29. | ls -l tmp joe | admin-links | Display a directory listing of "joe" showing that a sybolic link is set for "joe > tmp". |
| 30. | sar | admin-mon | Display today's CPU activity so far. The information must be present on the computer. |
| 31. | sar -A | admin-mon | Displays real time CPU activity for all items. |
| 32. | sar -c | admin-mon | Displays real time CPU activity for system calls. |
| 33. | sar -d | admin-mon | Displays real time CPU activity for block devices such as tape or disk. |
| 34. | sar -g | admin-mon | Displays real time CPU activity for paging. |
| 35. | sar -k | admin-mon | Displays real time CPU activity for kernel memory allocation (KMA). |
| 36. | sar -m | admin-mon | Displays real time CPU activity for message and semaphore activities. |
| 37. | sar -q | admin-mon | Displays real time CPU activity for average queue length while occupied, and percent of time occupied. |
| 38. | sar -r | admin-mon | Displays real time CPU activity for unused memory pages and disk blocks. |
| 39. | sar -u | admin-mon | Displays real time CPU utilization (the default). |
| 40. | sar -v | admin-mon | Displays real time for status of process, i-node and file tables. |
| 41. | sar -w | admin-mon | Displays real time for system swapping and switching. |
| 42. | sar 2 25 | admin-mon | Displays 25 snapshots, every 2 seconds, of the current system load. |
| 43. | top | admin-mon | Displays the most CPU-intensive tasks or processes on the system. This is an ongoing look at processor activity in real time. |
| 44. | ps -aux | admin-ps | Show process status for all processes with user ids. |
| 45. | ps -ag | admin-ps | Show process status for all processes. |
| 46. | ps -fu joe | admin-ps | Show process status for user joe of all processes. |
| 47. | ps -aef | grep /bin/uv | admin-ps | Show process status for all processes named uv |
| 48. | ps -fu joe | grep /bin/uv | admin-ps | Show process status for user joe of all processes named uv |
| 49. | ps -fu joe | wc -l | admin-ps | Count number of processes running for user joe. |
| 50. | chkconfig --list | admin-services | Show all active services |
| 51. | chkconfig --list cron | admin-services | Show status of service "cron" |
| 52. | umask | admin-umask | Show active mask to set permissions for newly created files. This is the octal format. |
| 53. | umask -S | admin-umask | Show active mask to set permissions for newly created files. This is the symbolic format. |
| 54. | umask 0000 | admin-umask | User file-creation mask to set permissions for newly created files. 0000 = 777 for directories & 777 for files. |
| 55. | umask 0002 | admin-umask | User file-creation mask to set permissions for newly created files. 0002 = 775 for directories & 664 for files. |
| 56. | umask 0007 | admin-umask | User file-creation mask to set permissions for newly created files. 0007 = chmod 770. |
| 57. | umask 0027 | admin-umask | User file-creation mask to set permissions for newly created files. 0027 = 760 for files. |
| 58. | who | admin-who | Shows all users logged in |
| 59. | who -Hu | admin-who | Shows all users logged with domain login and PID. |
| 60. | who am i | admin-who | Show who you are logged in as |
| 61. | who -r | admin-who | Show system run level with the last reboot date and time. |
| 62. | gedit | application | Graphical text editor |
| 63. | gimp | application | Powerful image processor |
| 64. | gphoto | application | Powerful photo editor |
| 65. | ruby | application | Ruby Scripting Language |
| 66. | bvi or bview | application | Visual Editor for binary files. |
| 67. | vim | application | Extended "vi" with colored script syntax. |
| 68. | ksysguard | application | KDE replacement for the gnome monitor. |
| 69. | cpio -ivctB < /dev/nrct0 | backup cpio | List all files on Cpio backup tape device nrct0 |
| 70. | cpio -ivcdBum uv.load < /dev/nrct0 | backup cpio | Loads file uv.load from tape device nrct0 |
| 71. | cpio -ivcdBum < /dev/nrct0 | backup cpio | Full restore from tape device nrct0 |
| 72. | find ./ -print -depth | cpio -ocvB > /tmp/Monday | backup cpio | Create a cpio backup of all files in the current directory saving it as file /tmp/Monday |
| 73. | cpio -ivcBt < /dev/rct0 > /tmp/tape.contents | backup cpio | Create a file named tape.contents of a file listing of the contents of a cpio backup tape device rct0 |
| 74. | tar -tvf /dev/rct0 | backup tar | Listing of the file contents on cartridge tape device rct0 |
| 75. | tar -tvf etc_backup | pg | backup tar | Show contents of the tar backup file "etc_backup" piping it thru pg to pause for each page of output. |
| 76. | tar -cvf etc_backup /etc | backup tar | Create a tar backup of the /etc directory in a file named etc_backup. The "-c" option will overlay the file "etc_backup" if it exists. |
| 77. | tar -cvf etc_backup.tar etc | backup tar | Create a tar backup of the etc directory in a file named etc_backup.tar. By not using the / before the directory etc the full path will not be saved and can be restored to a new directory path. The "-c" option will overlay the file "etc_backup.tar" if it exists. |
| 78. | tar -cvf test_backup.tar . | backup tar | Create a tar backup of the current directory in a file named test_backup.tar. By not using the / before the final . the full path will not be saved and can be restored to a new directory path. |
| 79. | tar -cvf /dev/rct0 /etc | backup tar | Create a tar backup of /etc on cartridge tape device rct0 |
| 80. | tar -cvf test_tar `cat '&SAVEDLISTS&/FLIST'` | backup tar | Create a tar backup named "test_tar" of the list of files stored in the file "FLIST" in the directory "&SAVEDLISTS&". Note that the tic character ` is used. |
| 81. | tar -cvf - USA* ENG* | gzip > /tmp/tar_archive.gz | backup tar | Create a tar backup of all files and directories with a prefix of "USA" or "ENG", pipe thru the gzip compression program and save the file as "tar_archive.gz" in the directory "/tmp". |
| 82. | nohup tar -cvf - USA* | gzip > /tmp/tar_archive.gz & | backup tar | Create a tar backup of all files and directories with a prefix of "USA" from the current directory, pipe thru the gzip compression program and save the file as "tar_archive.gz" in the directory "/tmp". The "nohup" option dissconnets your process from you shell "sh" and will continue to process even if you log off. The "&" option runs the process in the backgroud. |
| 83. | tar -xvf /dev/rcto /etc | backup tar | Restore file /etc from cartridge tape device rct0 |
| 84. | tar -xvf backup_tar | backup tar | Restore all files from the tar backup file backup_tar |
| 85. | time cat fname1 fname2 > fname3 | benchmark | The time command will display the amount of time used to execute command "cat fname1 fname2 > fname3". |
| 86. | diff -bi file1 file2 | compare | Compare the contents of file1 to file2. The "-b" option ignores blanks spaces and "-i" ignores case on each line. |
| 87. | diff -biy file1 file2 | compare | Compare the contents of file1 to file2. The "-b" option ignores blanks spaces, "-i" ignores case on each line and "-y" displays a 2 column report. |
| 88. | cc myprog.c | compiler | C compiler will compile the program myprog.c. |
| 89. | compress joe | compression | Using "compress", compress the file named joe as joe.Z and removes the file joe. |
| 90. | compress -v joe | compression | Using "compress", compress the file named joe as joe.Z and removes the file joe. The "-v" option will show the percent of compression. |
| 91. | compress -v joe joe5 joe6 | compression | Using "compress", compress multiple files named joe, joe5 and joe6. The "-v" option will show the percent of compression for each file. |
| 92. | compressdir Joe | compression | Compress all items in directory named Joe. |
| 93. | uncompress joe | compression | Using "uncompress", un-compress the file named joe.Z as joe and remove the file joe.Z. |
| 94. | find ./ -depth | gzip > /tmp/zfile.gz | compression | Using "gzip", compress the current directory of files into a file named "/tmp/zfile.gz". |
| 95. | gzip joe | compression | Using "gzip", compress the file named joe as joe.gz and removes the file joe. |
| 96. | gunzip joe | compression | Using "gzip", un-compress the file named joe.gz as joe and removes the file joe.gz. |
| 97. | zip joe | compression | Using "zip", compress the file named joe as joe.zip. |
| 98. | unzip joe | compression | Using "zip", un-compress the file named joe.zip as joe. |
| 99. | cat file1 >> file2 | concatenate | "cat" is short for concatenate. This example appends file1 onto the end of file2. |
| 100. | cat file1 file2 file3 > file50 | concatenate | "cat" is short for concatenate. This example combines the contents of file1, file2 and file3 into a new file named "file50". |
| 101. | cat cust* > cust_all | concatenate | "cat" is short for concatenate. This example combines files beginning with the name "cust" into a new file named "cust_all". |
| 102. | cp /etc/cust55 /temp | copy | Copy the file /etc/cust55 to the/temp directory |
| 103. | cp file1 /usr/users/file2 | copy | Copy a file named file1 to a new directory /usr/users and name it file2 |
| 104. | cp -r docs /tmp | copy | Copy a directory named docs and all it's sub-directories to a directory named/tmp and keep the original name "docs". |
| 105. | cp -i oldfile newfile | copy | Copy a file named "oldfile" to a new file named "newfile". The -i prompts to overwrite "newfile" if it exits. |
| 106. | cp -i /docs/notes . | copy | Copy a file named "notes" to the current directory. |
| 107. | cp -Rpi /docs/hist . | copy | Copy a folder named "hist", recursively with all sub-folders and files to the current directory. The "p" option preserves current permissions. |
| 108. | cp -i oldfile ~/mydocs/newfile | copy | Copy a file named "oldfile" in the current directory to a new named "newfile" in the "mydocs" subdirectory of your home directory. The ~ character (tilde) is interpreted as the path of your home directory. |
| 109. | cp -R /usr/users/acct101 /usr/users/acct201 | copy | Copy the full contents of directory acct101 to the new directory acct201 |
| 110. | cp -Rp PURCH* /usr/users/acct201 | copy | Copy recursively all files and directories, from the current directory and with a prefix of "PURCH" , the "-p" option keeps the original permissions, to the new directory /acct201 |
| 111. | at -l | cron | List run once scheduled commands that will run. |
| 112. | at 01:50 < atjob | cron | Run one time the commands in the script "atjob" at 1:50am. |
| 113. | at -m 01:50 < atjob | cron | Run one time the commands in the script "atjob" at 1:50am. The "-m" option will send an email, once the job is run, to the user that started this command. |
| 114. | at -r 999999 | cron | Cancel a run once scheduled job "999999" scheduled by you. |
| 115. | crontab -l | cron | List all cron jobs running for the active user. |
| 116. | crontab -e | cron | Edit list of cron jobs that you can run. |
| 117. | crontab -l > cron_jobs | cron | Save all current running cron jobs to a file named "cron_jobs". |
| 118. | crontab cron_jobs | cron | Stop all running cron jobs, for the current user, and load new cron jobs defined in a file named "cron_jobs". Note that any active cron jobs will complete their process. To kill all cron jobs pass a file with null entries. |
| 119. | ps -ef | grep cron | cron | Check if cron is running. |
| 120. | ls -la | cut -c60-70 | cut | Cut out text from column 60 thru 70 from a directory listing. |
| 121. | ls -la | cut -c4,8 | cut | Cut out text from column 4 and column 8 from a directory listing. |
| 122. | ls -la | cut -d: -c2,4 | cut | Cut out text, using a ":" as a delimiter, from delimited column 2 and delimited column 4 from a directory listing. |
| 123. | ps -ef | cut -c4-11,12-17,48-999 | cut | Show processes running by displaying user id, PID and process. |
| 124. | date | date | Display the current day, date, time, and year. |
| 125. | pwd | dir | Display the name of the current directory. |
| 126. | cd .. | dir | Move up one directory level. |
| 127. | cd / | dir | Move to the root directory. |
| 128. | cd ~ | dir | Move to the home directory. |
| 129. | cd $RBHOME | dir | Move to the directory as defined by the environment variable $RBHOME. |
| 130. | cd /mnt/cust | dir | Change directory to /mnt/cust. |
| 131. | cd "&SAVEDLISTS&" | dir | Change to directory "&SAVEDLISTS&", note that file named needs quotes due to "&" being in the name. |
| 132. | ls -la | dir | Show a detailed directory listing of the current directory. |
| 133. | ls -lat | dir | Show a detailed directory listing of the current directory by-descending date/time modified. |
| 134. | ls -lit | dir | Show a directory listing of the current directory with the latest modifed files on top. |
| 135. | ls -lia | dir | Show a detailed directory listing of the current directory, including the i-node. |
| 136. | ls -1 | dir | Show a directory listing of the current directory, with file name only, in a single column format. |
| 137. | ls -b | dir | Show a directory listing of the current directory, showing file names with all non-printable characters. |
| 138. | ls -lia /tmp | dir | Show a detailed directory listing of the directory /tmp. |
| 139. | ls -Ri /tmp | dir | Show a recursive directory listing of the directory /tmp showing i-nodes. |
| 140. | ls -algR | dir | Show a recursive directory listing of the current directory. |
| 141. | ls -la usa*.gpg | dir | Show file listing of all files with a prefix of "usa" and a suffix of ".gpg". In the current directory. |
| 142. | ls -la *FEB09* | dir | Show file listing of all files with "FEB09" anywhere in the filename in the current directory. |
| 143. | ls | sort | pg | dir | Show a sorted directory listing and pause at the end of each page |
| 144. | ls | sort -r | pg | dir | Show a reverse sorted directory listing and pause at the end of each page |
| 145. | ls -la | sort -5 | pg | dir | Show a directory listing sorted by column 5 size, and pause at the end of each page. |
| 146. | find ./ -print | dir | Show a recursive directory listing of the current directory showing the full path. |
| 147. | ll | dir | Show a directory listing of the current directory, same as ls -la. Available on some systems only. |
| 148. | mkdir -p /temp/joe/workfile | dir | Make a directory named workfile. The "-p" option creates the complete directory path "/tmp/joe" if it is missing. |
| 149. | mkdir temp | dir | Make a directory named temp. |
| 150. | mkdir -R temp | dir | Delete directory named temp. The "-R" option purges all folders and files under the directory "temp" recursively. |
| 151. | mkdir temp temp2 temp3 | dir | Make multiple directories named temp, temp2 and temp3. |
| 152. | more /etc/fstab | display | Display file "/etc/fstab" pausing after each page. |
| 153. | gpg --gen-key | encryption-pgp | One Time build of keyring of encryption keys. Neede the first time you use pgp. |
| 154. | gpg --import joes_key.pub.gpg | encryption-pgp | Import a public key from the file "joes_key.pub.gpg" |
| 155. | gpg -r johndoe@webelink.com –encrypt sample.txt | encryption-pgp | Encrypt a file named "sample.txt". "johndoe@webelink.com" is an email address of a key that you previously imported. |
| 156. | gpg --output sample.txt --decrypt sample.txt.gpg | encryption-pgp | Decrypt a file named "sample.txt" |
| 157. | export MQPATH=/opt/mqpath | env-var | Sets the system environment var $MQPATH to "/opt/mqpath" |
| 158. | export PATH=$PATH:/usr/sbin | env-var | Adds /usr/sbin to the path in the system environment. |
| 159. | echo $PATH | env-var | Display current path. |
| 160. | echo $HOME | env-var | Display home directory. |
| 161. | echo $HOSTNAME | env-var | Display host system name. |
| 162. | echo $LOGNAME | env-var | Display login user name. |
| 163. | echo $TERM | env-var | Display terminal type ie. Wy50, vt100 or xterm. |
| 164. | echo $PWD | env-var | Display working directory. |
| 165. | echo $SHELL | env-var | Display active linux shell, ie. "/bin/ksh" or "/bin/bash". |
| 166. | echo $TZ | env-var | Display system time zone, ie. "CST6CDT". |
| 167. | echo $$ | env-var | Display your PID, process ID. |
| 168. | printenv | pg | env-var | Display your login environment to the standard output device. |
| 169. | sudo -l | execute | Execute a command as another user (list all valid commands for the current user) |
| 170. | sudo chmod 777 temp | execute | Execute a command as user "root" (change permissions for file temp) |
| 171. | ls / -R | wc -l & | execute-bgd | Using the option of & will run the process in the background to count number of lines in a directory listing. |
| 172. | fg {job#} | execute-bgd | Resume job# in the foreground, and make it the current job. If job# is not present, the shell's will use the current job. |
| 173. | df -k | filesystem | Show all file systems with blocks in kilobytes rather than the default 512 bytes. |
| 174. | df -h | filesystem | On some systems, shows a different format of the amount of space taken up on mounted file systems with percentage of usage. |
| 175. | df -xk | filesystem | Show all file systems with blocks in kilobytes bypassing links. |
| 176. | du | filesystem | Reports disk usage, the amount of space taken up by a group of files. The du command descends all subdirectories from the directory in which you enter the command, reporting the size of their contents, and finally reporting a total size for all the files it finds. To find out your usage, run du from your home directory. |
| 177. | du -s `ls` | filesystem | Reports disk usage, in summary form, of all files and directories from the current directory. |
| 178. | vgdisplay vg03 | filesystem | Display volume group vg03. |
| 179. | find ./ -print joe | find | Find a file named joe starting at the current directory. |
| 180. | find / -name joe | find | Find all files on the system named joe starting at the root directory. |
| 181. | find . -name '*joe*' -print | find | Find a file name with joe anywhere in the name starting at the current directory. |
| 182. | find /home -user joe -print | find | Find all files under the directory "/home" belonging to user "joe" |
| 183. | find . -name "*.txt" -print | find | Search in your current directory and its subdirectories for all of the files that end in the extension ".txt". |
| 184. | find $HOME -mtime 0 | find | Find all files in your home directory that have been modified the last 24 hours. |
| 185. | find /var/spool -mtime +30 | find | Find all files under the "/var/spool" directory that wer modified more than 30 days ago. |
| 186. | find "$HOME/" -name test.txt -print | find | Search in your home directory and its subdirectories for all files named "test.txt". |
| 187. | find ./?????* -print | find | Search for file names greater than 5 characters starting at current directory |
| 188. | find . -size 414c -print | find | Find files in the current directory with a byte size of 414 bytes. |
| 189. | find /temp -size +5200 -print | find | Find all files in the directory /temp with a file size greater than 52k |
| 190. | find . -size +5200 -exec ls -l {} \; | pg | find | Find all files in the current directory with a file size greater than 52k, then show size using ls -l with a pipe to pg for pagination. |
| 191. | find . -type f | grep -i Joe | find | Search the body of all files, for the string "Joe", starting at the current directory and all sub-directories. The "-i" option ignores case. |
| 192. | find / -type d | grep -i Joe | find | Search for all directories named "Joe", starting at the root directory and all sub-directories. The "-i" option ignores case. |
| 193. | find / -type l | grep -i Joe | find | Search for all symbolic links named "Joe", starting at the current directory and all sub-directories. The "-i" option ignores case. |
| 194. | ftp | ftp | Run FTP client. |
| 195. | ls | grep gnome | grep | A directory listing showing all files with "gnome" in the name. |
| 196. | ls -la | grep -v text | grep -v txt | grep | A directory listing showing all files excluding the files "text" and "txt". The "-v" option is to exclude text. |
| 197. | grep "100\*01" joe.txt | grep | Search the body of a file named "joe.txt" for all strings with "100*01" in them. Note the "\" informs unix to treat the "*" as a liternal not a wildcard character. |
| 198. | man ls | help | Show the documentation for the command ls from the online manual |
| 199. | man -k hostname | help | Show all documentation relating to the keyword "hostname" from the online manual |
| 200. | ls -help | help | Display help for the command ls |
| 201. | ls --help | help | Display help for the command ls on some Linux systems. |
| 202. | su joe | login | (Substitute User) Login as user joe. You will need the password for the user joe. Type exit to leave user joe and return to your user id. |
| 203. | su - | login | (Substitute User) Login as user root with the full profile environment, include extra space after "-". |
| 204. | su - joe | login | (Substitute User) Login as user joe with the full profile environment. |
| 205. | sync | memory | Force write requests in cache to be written to disk. |
| 206. | free | memory | Show system memory usage |
| 207. | ipcs -s | memory | Show Semaphore identifiers in use. |
| 208. | ipcs -mop | memory | Show shared memory segments in use. |
| 209. | ipcrm -m 13245 | memory | Remove shared memory segment 13245 |
| 210. | echo hello | misc | Write the word hello to the standard output device. |
| 211. | uname | misc | Display the kernal name. |
| 212. | uname -a | misc | Display all information about the kernal / linux system. |
| 213. | uname -s | misc | Display all operating system name. |
| 214. | date; ls -la | misc | Join 2 commands together and display the results. Use the ";" as the seperator. |
| 215. | dd | misc | Misc options to copy and format a files contents during the copy. |
| 216. | mach | misc | Show cpu type. |
| 217. | arch [-k | archname ] | misc | Display the architecture of the current host. |
| 218. | startx | misc | Start x windows. |
| 219. | mv file1 file2 | move | Move or rename file1 to file2 |
| 220. | mv -i /abc/test55 /tmp/ | move | Move directory "/abc/test55" to the "/tmp" directory. The "-i" option makes sure you do not overwrite an existing file. |
| 221. | mv -i /abc/test55 ./ | move | Move directory "/abc/test55" to the current directory. The "-i" option makes sure you do not overwrite an existing file. |
| 222. | mv -i joe /opt/vendor | move | Moves the directory "joe" from the current directory to the directory /opt/vendor/joe". You must cd to the directory with "joe" first. The "-i" option makes sure you do not overwrite an existing file. |
| 223. | hostname | network | Display the name of your computer. |
| 224. | hostname galaxy501 | network | Set your computer name to "galaxy501". |
| 225. | ping www.webelink.com | network | Ping the host www.webelink.com |
| 226. | traceroute www.webelink.com -l | network | Trace the route of network packets to the site www.webelink.com. |
| 227. | route | network | Display the routing table |
| 228. | netstat -an | network | Display the status information of the current network. |
| 229. | netstat -a | network | Display the status information for network sockets. |
| 230. | netstat -a | grep fastserve | network | Display the status information for inet service named "fastserve". |
| 231. | ifconfig | network | Display all network interfaces. |
| 232. | ifconfig eth0 | network | Display information for the eth0 network interface. |
| 233. | curl [options] [URL...] | network | Client to get documents/files from or send documents to a server, using any of the supported protocols (HTTP, HTTPS, FTP, GOPHER, DICT, TELNET, LDAP or FILE). |
| 234. | nslookup www.webelink.com | network | Query your default domain name server (DNS) for an Internet name or IP address of "www.webelink.com" |
| 235. | dig www.webelink.com | network | DNS lookup utility to get info on website "www.webelink.com" |
| 236. | wget ftp://ftp.ruby-lang.org/pub/ruby/ruby.tar.gz | network | Command line downloader. Get file "ruby.tar.gz" and save it in the current directory |
| 237. | wget www.webelink.com/index.htm | network | Command line downloader. Get file "index.htm" from the site "www.webelink.com" and save it in the current directory |
| 238. | dig -x 999.999.999.999 | network | DNS lookup utility to get info on IP: 999.999.999.999 |
| 239. | nmap 999.999.999.999 | network | Show open ports on IP: 999.999.999.999. |
| 240. | nmap www.webelink.com | network | Show open ports on the server located at www.webelink.com |
| 241. | nice -10 foo | nice | Run process named "foo" with a higher priority. Nice values are from 1-20. Positive numbers decrease priority of a job. Negative numbers increase the priority. The nice value of a job can be viewed with the "top" command. |
| 242. | /opt | paths | Home directory for 3rd party software. |
| 243. | /usr/local/bin | paths | Home directory for custom or user scripts and binaries. Should be copied for all system migrations. |
| 244. | /etc | paths | Unix configuration files. |
| 245. | /etc/crontab | paths-cfg | Crontab schedules for all users. |
| 246. | /var/spool/cron/atjobs | paths-cfg | Scheduled "at" jobs for all users. |
| 247. | /etc/passwd | paths-cfg | List of all system users. |
| 248. | /bin/init.d | paths-cfg | Folder contains Unix boot and shutdown scripts. |
| 249. | /etc/sudoers | paths-cfg | File controls who can run restricted commands. |
| 250. | /var/adm/syslog/sys.log | paths-cfg-hp | System error log on HP-UX Unix. |
| 251. | chmod 777 temp | permissions | Change file temp permission to allow full access -rwxrwxrwx. |
| 252. | chmod 777 * | permissions | Change all files in current dir for full permissions. |
| 253. | chmod -R 777 /usr/temp | permissions | Change all files recursively under the directory /usr/temp to full permissions. |
| 254. | chmod -R 777 /usr/acct/PORT.*/trans | permissions | Change all file named trans recursively under all derectories with a prefix of PORT. to full permissions -rwxrwxrwx |
| 255. | chmod 775 joe | permissions | Change file name joe to be executable. |
| 256. | chmod 700 temp | permissions | Change file named temp to be owner accesible |
| 257. | chmod 770 temp | permissions | Change file named temp to be group accesible -rwxrwx---. Owner and Group have full access, all others are denied access |
| 258. | chmod 755 temp | permissions | Change file named temp to be public access -rwxrwxr-x. Owner & Group can read, write & execute, all others can read & execute. |
| 259. | chmod 666 temp | permissions | Change file named temp to be -rw-rw-rw-. Everyone can read and write this file. |
| 260. | chmod 664 temp | permissions | Change file named temp to be -rw-rw-r--. Owner and group can read and write, all other may only read. |
| 261. | chmod 660 temp | permissions | Change file named temp to be -rw-r-----. Owner can read and write, group can read, all others have no access. |
| 262. | chown joe accounting | permissions | Change the owner of file joe to the owner accounting. |
| 263. | chown cook * | permissions | Change all file owners to owner cook in the current directory. |
| 264. | chown cook -R /usr/users/ | permissions | Change all file owners to cook recursively under the directory /usr/users |
| 265. | chown -R joe * | permissions | Change all files in the current directory and sub-directories to owner "joe". |
| 266. | chown -R uvsql:accounting joe | permissions | Change all files in the directory joe to owner uvsql and group accounting. The "-R" option is for recursive. |
| 267. | chgrp payroll * | permissions | Change all file groups to group payroll. |
| 268. | chgrp -R accounting * | permissions | Change all files in the current directory and sub-directories to group "accounting". |
| 269. | lpstat -a | printing | Show all printer queues with status and printer names. |
| 270. | lpstat hp101 | printing | Show all print jobs on printer "hp101". |
| 271. | cancel 7210 | printing | Cancel print job# "7210". |
| 272. | ls -l | lp -d hp101 | printing | Send a directory listing to a printer named "hp101". |
| 273. | man ftp | lp -d hp101 | printing | Send the man pages document for ftp to a printer named "hp101". |
| 274. | cat joe.txt | lp -d hp101 | printing | Send the text file named joe.txt to a printer named "hp101". |
| 275. | lp -d hp101 joe.txt | printing | Send the text file named joe.txt to a printer named "hp101". |
| 276. | enable hp101 | printing | Activates a printer named "hp101", this enables the printer to accept print requests issued by the lp command. |
| 277. | disable -c hp101 | printing | Disables a printer named "hp101", this prevents the printer from accepting print requests issued by the lp command. The "-c" option cancels any current print jobs printing. |
| 278. | export PS1="[${LOGNAME}@$(hostname)] # " | prompt | Set PS1 shell variable for the command line prompt to be "[Login ID @ host name]" such as "[joe@LinuxSvr]". |
| 279. | export PS1=[${LOGNAME}@$(hostname)]'$PWD>' | prompt | Set PS1 shell variable for the command line prompt to be "[Login ID @ host name] working directory" such as "[joe@LinuxSvr]/joe/home". |
| 280. | export PS2="#" | prompt | Set PS2 shell variable for the command line secondary prompt variable. The default is ">". |
| 281. | rmdir temp | purge | Remove or Delete the directory temp if it is empty. |
| 282. | rm -fr ./* | purge | Remove the current directory and all its sub-directories. The "-r" option allows you to delete non-empty directories. The "-f" option suppresses confirmation prompts. This is a powerful and dangerous command, use with caution. |
| 283. | rm -Rf SCC*-COPY | purge | Remove all files and directories from the currect path which have a prefix of "SCC" and a suffix of "-COPY". |
| 284. | rm -Rf \&TRUNCATED\& | purge | Remove the directory &TUNCATED& and all files within this directory from the currect path. The "\" character treats the next character "&" as a character only not a command. |
| 285. | rm -r /joe | purge | Remove the directory "/joe" and all its sub-directories. The "-r" option allows you to delete non-empty directories. The "-f" option suppresses confirmation prompts. This is a powerful and dangerous command, use with caution. |
| 286. | rm cust55 | purge | Remove the file named cust55 from the current directory |
| 287. | find /tmp -name core -type f -print | xargs /bin/rm -f | purge | Find and purge all files named "core" in or below the directory /tmp |
| 288. | find . -type f -name "*2008*" | xargs rm -f | purge | Find and purge all files with "2008" anywhere in the file name from the current directory. The "-f" option suppresses confirmation prompts. Xargs will run fast due to running multiple threads. |
| 289. | find . -mtime +7 | xargs rm -f | purge | Find and purge all files that were modified 7 or more days ago from the current directory. The "-f" option suppresses confirmation prompts. Xargs will run fast due to running multiple threads. |
| 290. | ls -lia > /tmp/filelist | redirect | (stdout) Show the directory listing saving the output text in a file named /tmp/filelist. |
| 291. | ls -lia >> /tmp/filelist | redirect | (stdout) Show the directory listing saving the output text in a file named /tmp/filelist, append to the target file if it exists. |
| 292. | grep joe 2> grep-errors.txt | redirect | (stderr) Save the stderr output of the grep program to a file named "grep-errors.txt". |
| 293. | grep joe 1> &2 | redirect | (stdout) Write the stdout of the grep program to a "stderr". |
| 294. | grep joe 2> &1 | redirect | (stderr) Write the stderr of the grep program to a "stdout". |
| 295. | rm -f $(find / -name core) &> /tmp/purge.log | redirect | (stderr, stdout) Purge all files named "core" and write all output of the "rm" command to a file named "purge.log". |
| 296. | scp *.pl joe@10.1.5.5/home/scripts | scp | Copy all files with a suffix of ".pl" to a remote server at IP "10.1.5.5" for user "joe", to the directory "/home/scripts". This is a secure copy and SSH needs to be installed on both systems. |
| 297. | #!/bin/ksh | script | 1st line in script, use korn shell for all commands in this script. |
| 298. | #!/bin/bash | script | 1st line in script, use bash shell for all commands in this script. |
| 299. | echo $? | script | Exit status of last shell command executed. A "0" is returned if the last command was successful or a "1" if un-successful. |
| 300. | exit 115 | script | Return an exit code of "115" to the shell. |
| 301. | passwd | security | Change your login password. |
| 302. | passwd joe | security | Change login password for user joe. |
| 303. | script | security | Log user activity, keyboard entry and outout, saving in a default log file named typescript. Type "exit" to exit logging. |
| 304. | script -a joe.ulog | security | Log user activity, keyboard entry and outout, saving in a log file named joe.ulog. Type "exit" to exit logging. |
| 305. | script -c ksh | security | Start a new korn shell, with user activity logging of keyboard entry and save it in a log file named typescript. Type "exit" to exit logging. This is available on some systems only. |
| 306. | set stty erase {bs} | set | Set your backspace key for your process by entering the {bs}. |
| 307. | /bin/ksh | shells | Korn Shell (most popular with Unix systems) |
| 308. | /bin/bash | shells | Bash Shell (most popular with free Linux systems) |
| 309. | /bin/csh | shells | C-Shell |
| 310. | /bin/sh | shells | Bourne shell, standard default Shell. |
| 311. | shutdown -h 0 | shutdown | Shutdown now on Red Hat Linux. |
| 312. | shutdown -h now | shutdown | Shutdown now on Red Hat Linux. |
| 313. | sudo shutdown -h 0 | shutdown | Shutdown now on Debian or Ubuntu Linux. |
| 314. | sleep 5 | sleep | Sleep for 5 seconds. |
| 315. | sudo apt-get install chkconfig | software Ubuntu | Install of "chkconfig" services utility on Debian or Ubuntu Linux. |
| 316. | sudo apt-get install di | software Ubuntu | Install of "di" disk utility command software on Debian or Ubuntu Linux. |
| 317. | sudo apt-get install nmap | software Ubuntu | Install nmap, a network exploration and security tool with open port scanner. |
| 318. | sudo apt-get install konsole | software Ubuntu | Install konsole, free terminal emulator for the KDE Desktop Environment. |
| 319. | sudo apt-get install ruby | software Ubuntu | Install of "Ruby" scripting software on Debian or Ubuntu Linux. |
| 320. | sudo apt-get install bvi | software Ubuntu | Install of "bvi" visual editor for binary files software on Debian or Ubuntu Linux. |
| 321. | sudo apt-get remove bvi | software Ubuntu | Remove package "bvi" visual editor for binary files software on Debian or Ubuntu Linux. Software will be purged but configuration files will remain intact on the system. |
| 322. | sudo apt-get --purge remove bvi | software Ubuntu | Complete removal of package "bvi" visual editor for binary files software on Debian or Ubuntu Linux. Software and configuration files will be purged. |
| 323. | sudo apt-get update | software Ubuntu | Update the list of available packages. The apt-get program uses this database to determine dependencies and how to install packages. Run this regularly to keep system informed of package updates particularly security updates. |
| 324. | sudo apt-get -u upgrade | software Ubuntu | Upgrade all active packages. The "-u" option shows which packages will be upgraded. It is important that you run a apt-get update before you run this command. |
| 325. | sudo apt-get install ubuntu-desktop | software Ubuntu | Install of Ubuntu GUI Desktop software on Debian or Ubuntu Linux. This is a way to install desktop software on the server version. |
| 326. | sudo apt-get install -f | software Ubuntu | Run this command after a failed "apt-get install" to get all missing packages or software. Then re-run the original install program. |
| 327. | ls -lia | sort -r | sort | Issue the list directory command and do a reverse sort on the output. |
| 328. | split -l 700 access.log | split | Split the file "access.log" into smaller files of less than 700 lines for each file. |
| 329. | ssh 10.x.x.x | ssh | Make an SSH Secure Shell Connection to ip: 10.x.x.x login as default user. |
| 330. | ssh root@10.x.x.x | ssh | Make an SSH Secure Shell Connection to ip: 10.x.x.x login as user root. |
| 331. | ssh -C -X joe@192.168.101.5 | ssh | Make an SSH Secure Shell Connection to ip: 192.168.101.5 as user joe. The "-C" will compress all traffic. The "-X" runs xterm passing parameters. |
| 332. | ssh -2 -v svr-orion | ssh | Force SSH to run SSH2 Secure Shell Connection to server svr-orion. The "-v" option is for verbose and shows all parms. |
| 333. | cat fname1 fname2 > newfile 2> stderr_file | stderr | "2> stderr_file" option redirects std error messages to a file name "stderr_file" after executing a "cat" command of files "fname1" and "fname2" to a new file named "newfile". |
| 334. | who -Hu 2> stderr_file > newfile | stderr | Run command "who -Hu" saving errors to a file named "stderr_file" and capture the results of this command to a new file named "newfile". |
| 335. | cat fname1 fname2 > filename3 | stdout | Redirect standard out to a file named "filename3" after executing a "cat" of files "fname1" and "fname2". File name "filename3" will be over-written. |
| 336. | cat fname1 fname2 >> filename3 | stdout | Redirect standard out to a file named "filename3" after executing a "cat" of files "fname1" and "fname2". File name "filename3" will be appended to. |
| 337. | touch -version /temp/joe.txt | touch | Output the version information only and exit for the file named /temp/joe.txt. |
| 338. | touch -a /temp/joe | touch | Change the file access time on the file named /temp/joe. |
| 339. | touch -m /temp/joe.txt | touch | Change the file modification time on the file named /temp/joe.txt. |
| 340. | touch joe.txt | touch | Create an empty file named joe.txt in the current directory. |
| 341. | tr -d '\0' < joe.txt > newfile | Translate | Delete all null characters from a file named "joe.txt" and save a new file named "newfile". |
| 342. | cat joe.txt | tr -d '\0' | uniq > newfile | Translate | Delete all null characters from a file named "joe.txt" and save a new file named "newfile". Apply the uniq filter to remove all duplicate lines. |
| 343. | tr -d '\015' < pc.file > unix.file | Translate | Remove all <cr> from <cr><lf> sequence (using octal 015 for <cr>). This will convert a PC text file, delimited by <cr><lf>, to a Unix <lf> delimited text file. |
| 344. | cat joe.txt | tr '[:upper:]' '[:lower:]' > lc_joe.txt | Translate | Convert all upper case letters in a file named "joe.txt" to all lower case letters in a new file named "lc_joe.txt" |
| 345. | cat joe.txt | sort | uniq > joe2.txt | unique | Removes duplicate lines from the file "joe.txt" and outputs the result to to a file named "joe2.txt". Using the sort filter may remore more duplicates because duplicates are defined as two sequential and identical lines. |
| 346. | uniq -c joe.txt > joe2.txt | unique | Removes duplicate lines from the file "joe.txt" and outputs the result to to a file named "joe2.txt". Precede each output line with a count of the number of duplicates in "joe1.txt". |
| 347. | uniq -d joe.txt > joe2.txt | unique | Removes duplicate lines from the file "joe.txt". Suppress the writing of lines that are not repeated in "joe1.txt" to a file named "joe2.txt". |
| 348. | uniq -u joe.txt > joe2.txt | unique | Removes duplicate lines from the file "joe.txt". Suppress the writing of lines that are repeated in "joe1.txt" to a file named "joe2.txt". |
| 349. | cat test.txt | pg | viewing | Display the contents of a file named test.txt to the standard output device, piping to pg for a page pause. |
| 350. | cat test.txt | more | viewing | Display the contents of a file named test.txt to the standard output device, piping to more for a page pause. |
| 351. | less test.txt | viewing | Display the contents of a file named test.txt to the standard output device, pausing for each page, allowing to scroll forward or backward thru file. |
| 352. | more test.txt | viewing | Display the contents of a file named test.txt to the standard output device, pausing with a more for each page. |
| 353. | head -ln 50 test.txt | viewing | Display the first few lines of a file named test.txt to the standard output device. |
| 354. | head test.txt | viewing | Display the first few lines of a file named test.txt to the standard output device. |
| 355. | tail test.txt | viewing | Display the last few lines of a file named test.txt to the standard output device. |
| 356. | tail -n 200 test.txt | viewing | Display the last 200 lines of a file named test.txt to the standard output device. |
| 357. | tail -f process.log | viewing | Display the last few lines of a file named process.log to the standard output device. The "-f" performs a continuos looping action and allows monitoring of a log file for realtime changes. |
| 358. | ls -lia | wc - l | word count | Count the number of lines in the current directory listing. |
| 359. | cat text.txt | wc | word count | Count words in the file named test.txt. |
| 360. | cat text.txt | wc & | word count | Count words in the file named test.txt. The "&" informs the process to run in the background. The result will display to stdout or screen. |
| © Copyright 2003-2010 webelink.com. All Rights Reserved. | Click to Email for Info | Terms of Use | | |||