Linux and Unix System Administration Shell Commands HomePage 
Powered by www.webelink.com   8/23/2014  
 This Linux shell commands reference guide is geared toward experienced Linux users. You can quickly find the correct command line syntax,
 with commonly used options, and bypass searching the man pages. Some commands may not be available on your Linux platform or may need
 to be installed separately. This guide is not designed to be a detailed Linux how to manual.
#  Command  Type  Description
1. uptime admin Show how long the system has been running since last reboot. Also show the average load.
2. cat /proc/cpuinfo admin Show CPU info
3. cat /proc/version admin Show Linux version info.
4. lsb_release -d -s -c admin Show the Linux version info on Debian or Ubuntu Linux.
5. cat /etc/lsb-release admin Show the Linux version info on Debian or Ubuntu Linux.
6. fdisk -l admin-fdisk Display available disks. Linux partion table utility.
7. file /tmp/test.file admin-file Shows file type for file "/tmp/test.file", such as text, tar, script, ascii text or executable.
8. finger admin-finger Show all active system users.
9. finger -lmsp admin-finger Show detailed information on all active users.
10. finger joe admin-finger System info about user "joe" such as home directory and last login.
11. fuser -u VOC admin-fuser Show all process IDs using the file "VOC". (May be a restricted Command for non-admins)
12. fuser -u /dev/rmt0 admin-fuser Show all process IDs using the tape drive device "/dev/rmt0"
13. history | pg admin-hist Show the last several hundred commands executed from the command line on the current account. The "history" command is a built-in shell command.
14. history 20 admin-hist Show the last 20 commands executed from the command line from the current account.
15. history - admin-hist Clear your shell command line history.
16. history -c admin-hist Clear your shell command line history.
17. history -w joe_hist admin-hist Save your current shell command line history in a file named "joe_hist".
18. id admin-id Show your login information including UID and GID.
19. id -u admin-id Show your login UID (User ID) only.
20. id -g admin-id Show your login GID (Group ID) only.
21. id joe admin-id Show login information for user joe
22. ioscan admin-ioscan Show all hardware devices.
23. ioscan -funC tape admin-ioscan Show all hardware devices assigned for tape drives.
24. ioscan -funC disk admin-ioscan Show all hardware devices assigned for disk drives.
25. last admin-last Shows a history of all user logins by descending date.
26. last | grep joe | more admin-last Shows a history of user "joe" logins by descending date and pause after each page of display.
27. last -10 admin-last Shows a history of user logins by descending date, of the last 10 logins.
28. last -t YYYYMMDDHHMMSS admin-last Shows a history of user logins by the specified date and time.
29. /usr/bin/system-config-lvm admin-lvm A GUI for LVM Logical Volume Magement, utility allows you to manage logical volumes within X windows or graphically
30. ps -aux admin-ps Show process status for all processes with user ids.
31. ps -ag admin-ps Show process status for all processes.
32. ps -fu joe admin-ps Show process status for user joe of all processes.
33. ps -aef | grep /bin/uv admin-ps Show process status for all processes named uv
34. ps -fu joe | grep /bin/uv admin-ps Show process status for user joe of all processes named uv
35. ps -fu joe | wc -l admin-ps Count number of processes running for user joe.
36. chkconfig --list admin-services Show all active services
37. chkconfig --list cron admin-services Show status of service "cron"
38. service smb restart admin-services Restart the Samba Daemon.
39. service sshd restart admin-services Restart the SSH Daemon.
40. su joe admin-su (Substitute User) Login as user "joe". You will need the password for the user "joe", unless running from user "root". Type exit to leave user joe and return to your original user id.
41. su - joe admin-su (Substitute User) Login as user joe with the full profile environment for user "joe". Your login menus will look identical as if you logged in as the real user "joe".
42. su - admin-su (Substitute User) Login as user root with the full profile environment, remember to include the extra space after "-".
43. top admin-top Displays the most CPU-intensive tasks or processes on the system. This is an ongoing look at processor activity in real time.
44. uname admin-uname Display the kernal name.
45. uname -a admin-uname Display all information about the kernal / linux system.
46. uname -s admin-uname Display all operating system name.
47. uname -m admin-uname Display the hardware machine name, ie. "i686"
48. uname -n admin-uname Display the system name, ie. "vmCOS201"
49. w admin-w Show all active logged in users and the process that they are running and shell type.
50. w joe admin-w Show all active sessions for user "joe" that are running and the shell type.
51. who admin-who Shows all users logged in
52. who -Hu admin-who Shows all users logged with domain login and PID.
53. who am i admin-who Show who you are logged in as
54. who -r admin-who Show system run level with the last reboot date and time.
55. alias alias List all shortcut alias commands defined as an alias. The "alias" command is a built-in shell command.
56. alias home='cd /home/joe/libs' 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.
57. alias ll='ls -lia' alias Create a shortcut named "ll" to run the command "ls -lia" whenever a user types "ll" from a command prompt.
58. alias ll='pg=more' alias Create a synonym command named "pg" to run the command "more" for pausing on each page of display.
59. alias bdf='di -lt' alias Create a shortcut named "bdf" to run the command "di -lt" whenever a user types "bdf" from a command prompt.
60. alias vi=vim alias Create a shortcut named "vi" to run the command "vim" whenever a user types "vi" from a command prompt. VIM is an improved version of vi.
61. bvi or bview application Visual Editor for binary files.
62. gedit application Graphical text editor
63. gimp application Powerful image and photo processor http://www.gimp.org/
64. gphoto application Powerful photo editor
65. hadoop application Open source java framework for processing vast amounts of data on large clusters of commodity servers http://hadoop.apache.org/
66. ksysguard application KDE replacement for the gnome monitor.
67. Mondo Rescue application Linux Rescue Software to create bare metal restore images. A GPL disaster recovery solution. http://www.mondorescue.org/
68. OpenFiler - Storage application application Open Source Storage Appliance Software for Linux. http://www.openfiler.com/
69. Perl Programming Language application Perl Programming Language, Open Source runs on Linux, Windows and Mac OS X.
http://www.perl.org/
70. pfSense open source firewall application pfSense is a free open source firewall and router software based on FreeBSD Unix.
http://www.pfsense.com/
71. Python Programming Language application Python Programming Language, Open Source runs on Linux, Windows and Mac OS X.
http://www.python.org/
72. realvnc application Remote Control software (free personal version of remote desktop for Windows) http://www.realvnc.com/index.html
73. ruby application Ruby Scripting Language
74. tightvnc application Remote Control software (free remote desktop for Windows)
75. vim application Extended "vi" with colored script syntax.
76. Webmin application A web-based interface for system administrators for Linux. http://www.webmin.com/
77. cpio -ivctB < /dev/nrct0 backup cpio List all files on Cpio backup tape device nrct0
78. cpio -ivcdBum uv.load < /dev/nrct0 backup cpio Loads file uv.load from tape device nrct0
79. cpio -ivcdBum < /dev/nrct0 backup cpio Full restore from tape device nrct0
80. 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
81. 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
82. tar -tvf /dev/rct0 backup tar Listing of the file contents on cartridge tape device rct0
83. 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.
84. 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.
85. 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.
86. 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.
87. tar -cvf /dev/rct0 /etc backup tar Create a tar backup of /etc on cartridge tape device rct0
88. 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.
89. 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.
90. tar -cvf - USA* APP* | gzip > /tmp/tar_archive.gz backup tar Create a tar backup of all files and directories with a prefix of "USA" or "APP", pipe thru the gzip compression program and save the file as "tar_archive.gz" in the directory "/tmp".
91. gunzip < /tmp/tar_archive.gz | tar -xvf - backup tar Unzip and restore all files from the tar archive "tar_archive.gz" in the curent directory. The original tar should have been created with the "-c" option to not save the full path.
92. tar -xvf /dev/rcto /etc backup tar Restore file /etc from cartridge tape device rct0
93. tar -xvf backup_tar backup tar Restore all files from the tar backup file backup_tar
94. time cat fname1 fname2 > fname3 benchmark The time command will display the amount of time used to execute command "cat fname1 fname2 > fname3".
95. cc myprog.c c-compiler C compiler will compile the program myprog.c.
96. gcc hello.c -o hello c-compiler Compile "c" program named "hello.c" generating a binary executable named "hello". www.gcc.gnu.org home of the free gnu "c" compiler.
97. gcc -Wall hello.c -o hello c-compiler Compile "c" program named "hello.c" generating a binary executable named "hello".
98. cat -n myfile.txt cat Display the file "myfile.txt" on the screen and print the line number before each line that is output.
99. cat -v myfile.txt cat Display the file "myfile.txt" on the screen and show all non-printing characters, except for line feeds and tabs.
100. 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.
101. 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.
102. compress -V compress Show the version of the "compress" and "uncompress" utility programs.
103. compress joe compress Using "compress", compress the file named joe as joe.Z and removes the file joe.
104. compress -v joe compress Using "compress", compress the file named joe as joe.Z and removes the file joe. The "-v" option will show the percent of compression.
105. uncompress joe compress Using "uncompress", un-compress the file named joe.Z as joe and remove the file joe.Z.
106. compress -rv temp compress Using "compress" utility, compress all files recursively in the folder "/temp". The "v" option is for verbose and shows all files being compressed.
107. uncompress -rv temp compress Using "uncompress" utility, un-compress all files recursively in the folder "/temp".
108. find ./ -depth | gzip > /tmp/zfile.gz compress-zip Using "gzip", compress the current directory of files into a file named "/tmp/zfile.gz".
109. gzip joe compress-zip Using "gzip", compress the file named joe as joe.gz and removes the file joe.
110. gunzip joe.gz compress-zip Using "gzip", un-compress the file named joe.gz as joe and removes the file joe.gz.
111. zip joe compress-zip Using "zip", compress the file named joe as joe.zip.
112. unzip joe.zip compress-zip Using "zip", un-compress the file named joe.zip as joe.
113. 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.
114. cat file1 >> file2 concatenate "cat" is short for concatenate. This example appends file1 onto the end of file2.
115. 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".
116. 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".
117. cp /etc/cust55 /temp copy Copy the file /etc/cust55 to the/temp directory
118. cp file1 /usr/users/file2 copy Copy a file named file1 to a new directory /usr/users and name it file2
119. 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".
120. 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.
121. cp -i /docs/notes . copy Copy a file named "notes" to the current directory.
122. 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.
123. 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.
124. cp *TEST* "/opt/APL/&SAVEDLISTS&" copy Copy all files, with "TEST" anywhere in the file name, from the current directory to a folder named "/opt/APL/&SAVEDLISTS&". Note the quotes around the target file path due the the reserved character "&" in the name.
125. cp -R /usr/users/acct101 /usr/users/acct201 copy Copy the full contents of directory acct101 to the new directory acct201
126. cp -Rpi /usr/users/acct101 /usr/users/acct201 copy Copy the full contents of directory acct101 to the new directory acct201 preserving all permissions.
127. 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
128. find . -type f | wc -l count Count the number of files in the current directory.
129. find / -type f | wc -l count Count the number of files on the system, starting at the root directory.
130. find / -type d | wc -l count Count the number of directories on the system, starting at the root directory.
131. ls -lia | wc -l count Count all the files in the current directory.
132. at -l cron List run once scheduled commands that will run.
133. at 01:50 < atjob cron Run one time the commands in the script "atjob" at 1:50am.
134. 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.
135. at -r 999999 cron Cancel a run once scheduled job "999999" scheduled by you.
136. crontab -l cron List all cron jobs running for the active user.
137. crontab -e cron Edit list of cron jobs that you can run.
138. crontab -l > cron_jobs cron Save all current running cron jobs to a file named "cron_jobs".
139. 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.
140. ps -ef | grep cron cron Check if cron is running.
141. http://127.0.0.1:631 cups CUPS (Common Unix Printing System) printer administration web page on Linux.
142. cupsenable hplj4 cups Enable a printer named "hplj4" with cups.
143. ls -la | cut -c60-70 cut Cut out text from column 60 thru 70 from a directory listing.
144. ls -la | cut -c4,8 cut Cut out text from column 4 and column 8 from a directory listing.
145. 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.
146. ps -ef | cut -c4-11,12-17,48-999 cut Show processes running by displaying user id, PID and process.
147. cut –d: -f1 /etc/passwd cut Read the file "/etc/passwd" and display all user ids, showing column 1 only delimited by a ":" character.
148. cut –d":" -f1,5 /etc/passwd cut Read the file "/etc/passwd" and display all user ids and real names, showing column 1 and column 5 delimited by a ":" character.
149. cut –d":" -f1,5,7 /etc/passwd cut Read the file "/etc/passwd" and display all user ids, real names and Unix shells, showing column 1,column 5 and column 7 delimited by a ":" character.
150. cat joe.txt | dos2unix > joe2.txt data-conv Data conversion for text files, convert the file "joe.txt" to a new file "joe2.txt" replacing all <cr> or <cr><lf> sequences to <lf> as required for Unix.
151. cat joe.txt | unix2dos > joe2.txt data-conv Data conversion for text files, convert the file "joe.txt" to a new file "joe2.txt" replacing all <lf> sequences to <cr><lf> as required for Windows DOS.
152. date date Display the current day, date, time, and year, ie. Sat Jul 7 10:31:34 CDT 2012
153. date -u date Display the current day, date, time, and year in Coordinated Universal Time format, ie. Fri Jul 6 15:34:11 UTC 2012
154. di di Disk Information utility, display file system size, space available and percent used. The default di command uses options "smbuvpT"
155. di -a di Disk information utility, displays all mounted file systems. The "-a" option shows all file systems including ones with 0 total blocks.
156. di -lt di Display local mounted file systems. The "-l" option is for local file systems only and "-t" will show a total line.
157. pwd dir Display the name of the current directory.
158. cd .. dir Move up one directory level.
159. cd ../joe dir Move up one directory level and then to a folder named "joe".
160. cd / dir Move to the root directory.
161. cd dir Move to your home directory.
162. cd ~ dir Move to your home directory.
163. cd $RBHOME dir Move to the directory as defined by the environment variable $RBHOME.
164. cd /mnt/cust dir Change directory to /mnt/cust.
165. cd "&SAVEDLISTS&" dir Change to directory "&SAVEDLISTS&", note that the file name needs quotes due to the reserved "&" character in the name.
166. cd \&SAVEDLISTS\& dir Change to directory "&SAVEDLISTS&", note that the file name needs "\" before each "&" character which is a reserved Linux character.
167. find ./ -print dir Show a recursive directory listing of the current directory showing the full path.
168. more /etc/fstab display Display file "/etc/fstab" pausing after each page.
169. cat test.txt | pg display Display the contents of a file named test.txt to the standard output device, piping to pg for a page pause.
170. cat test.txt | more display Display the contents of a file named test.txt to the standard output device, piping to more for a page pause.
171. less test.txt display 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.
172. more test.txt display Display the contents of a file named test.txt to the standard output device, pausing with a more for each page.
173. head -ln 50 test.txt display Display the first few lines of a file named test.txt to the standard output device.
174. head test.txt display Display the first few lines of a file named test.txt to the standard output device.
175. tail test.txt display Display the last few lines of a file named test.txt to the standard output device.
176. tail -n 200 test.txt display Display the last 200 lines of a file named test.txt to the standard output device.
177. tail -f process.log display 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.
178. echo hello echo Write the word hello to the standard output device.
179. echo hello > joe.txt echo Write the word hello to a file named "joe.txt" over write the file if present.
180. echo -n "hello" echo Display the word hello to the standard output device. The "-n" option will suppress the trailing <lf> character.
181. echo $HOME echo Display your home directory.
182. echo $$ echo Display your PID or Linux Process ID.
183. echo \"joe\" echo Display "joe" with quotes. The "\" character treats the next character as a literal not a shell command.
184. echo ~ echo Display your home directory, for example "/home/joe".
185. gpg --gen-key encryption-pgp One Time build of keyring of encryption keys. Neede the first time you use pgp.
186. gpg --import joes_key.pub.gpg encryption-pgp Import a public key from the file "joes_key.pub.gpg"
187. 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.
188. gpg --output sample.txt --decrypt sample.txt.gpg encryption-pgp Decrypt a file named "sample.txt"
189. export MQPATH=/opt/mqpath environment Sets the system environment variable $MQPATH to "/opt/mqpath"
190. export PATH=$PATH:/usr/sbin environment Adds /usr/sbin to the path in the system environment.
191. echo $PATH environment Display current path.
192. echo $HOME environment Display home directory.
193. echo $HOSTNAME environment Display host system name.
194. echo $LOGNAME environment Display login user name.
195. echo $TERM environment Display terminal type ie. Wy50, vt100 or xterm.
196. echo $PWD environment Display working directory.
197. echo $SHELL environment Display active linux shell, ie. "/bin/ksh" or "/bin/bash".
198. echo $TZ environment Display system time zone, ie. "CST6CDT".
199. echo $$ environment Display your PID, process ID.
200. printenv | pg environment Display your complete login environment to the standard output device.
201. ./joe.sh execute Execute the command "joe.sh" from the current directory. Note that the prefix "./" is required if the command to run is in the current directory.
202. 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.
203. 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.
204. sudo -l execute-sudo Execute a command as another user (list all valid commands for the current user)
205. sudo chmod 777 temp execute-sudo Execute a command as user "root" (change permissions for file temp)
206. /usr/bin/sudo -u joe /usr/bin/status execute-sudo Execute a command as user "joe" (run command "status"). The "-u" option allows entry of a user login after the option.
207. sudo -E -u joe /usr/bin/status execute-sudo Execute a command as user "joe" (run command "status"). The "-u" option allows entry of a user login, the "-E" preserves your current environment variables and passes them to the new shell.
208. stat joe.txt file info Show properties for file "joe" such as inode, permissions and file access dates. The Modify date
209. stat -f joe.txt file info Show file system properties for file "joe" such as file system type, block size and total inodes used.
210. find . -type f > filelist.txt file list Build a list of all files, in the current directory, and save it in a file named "filelist.txt".
211. find . -type d > dirlist.txt file list Build a list of all directories, in the current directory, and save it in a file named "dirlist.txt".
212. df -k filesystem Show all file systems with blocks in kilobytes rather than the default 512 bytes.
213. 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.
214. df -xk filesystem Show all file systems with blocks in kilobytes bypassing links.
215. 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.
216. du -s `ls` filesystem Reports disk usage, in summary form, of all files and directories from the current directory.
217. vgdisplay -A filesystem Display all active volume groups.
218. vgdisplay vg03 filesystem Display volume group vg03 properties.
219. find / -name joe find Find all files on the system named joe starting at the root directory.
220. find ./ -print joe find Find a file named joe starting at the current directory.
221. find . -name '*joe*' -print find Find a file name with joe anywhere in the name starting at the current directory.
222. find /home -user joe -print find Find all files under the directory "/home" belonging to user "joe"
223. find . -name "*.txt" -print find Search in your current directory and its subdirectories for all of the files that end in the extension ".txt".
224. find $HOME -mtime 0 find Find all files in your home directory that have been modified the last 24 hours.
225. find "$HOME/" -name test.txt -print find Search in your home directory and its subdirectories for all files named "test.txt".
226. find /var/spool -mtime +30 find Find all files under the "/var/spool" directory that were modified more than 30 days ago.
227. find / -mtime -5 find Find all files on your system that were modified within the last 5 days.
228. find ./?????* -print find Search for file names greater than 5 characters starting at current directory
229. find . -size 414c -print find Find files in the current directory with a byte size of 414 bytes.
230. find /temp -size +5200 -print find Find all files in the directory /temp with a file size greater than 52k
231. 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.
232. 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.
233. 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.
234. 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.
235. find / -type f -mmin -90 | xargs -r ls -l find Search the entire system for files that were modified in the last 90 minutes. The "-r" option tells xargs to not issue "ls -l" if no files were found.
236. find . -type d | sort | xargs /opt/uv/bin/fnuxi find Search for all files and directories, from the current directory, and pipe them thru a sort. Then run the utility program "fnuxi" for each file, passing the filename as a command line argument.
237. ls *.log | sort | xargs cat | grep "err" | grep "print" find Sort all files, in the current directory, with a suffix of ".log" and show all lines, within each file, with the word "err" and "print" on the same line.
238. ftp ftp Run FTP client.
239. sftp 999.999.999.999 ftp Run Secure FTP client and connect to ip: 999.999.999.999.
240. ls | grep gnome grep A directory listing showing all files with "gnome" in the name.
241. 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.
242. 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.
243. grep joe temp.lst grep Search the body of a file named "temp.lst" for the string "joe".
244. grep -w joe temp.lst grep Search the body of a file named "temp.lst" for the word "joe", meaning a word seperated by a space.
245. grep -nw joe temp.lst grep Search the body of a file named "temp.lst" for the word "joe", meaning a word seperated by a space. The "n" option precedes each line with the line number where it was found.
246. grep "192.168" * grep Search the current folder for all files containing the string "192.168" within the body of the files.
247. grep -l "joe" * grep Search the current folder for all files containing the string "joe". The "-l" option will only show the file names not the lines that contain the text.
248. grep -i "joe" * grep Search the current folder for all files containing the string "joe". The "-i" option will ignore case (uppercase or lowercase).
249. grep -r "joe" * grep Recursive search of the current folder, and sub-folders, for all files containing the string "joe".
250. grep '\<c…h\>' /usr/temp.list grep Search the body of a file named "temp.lst" for a list of 5 letter words starting with a "c" and ending in "h".
251. grep '\<c.*h\>' /usr/temp.list grep Search the body of a file named "temp.lst" for a list of all words starting with a "c" and ending in "h".
252. grep "joe" *.html grep Search the current folder for all HTML files, containing the string "joe".
253. grep -e "joe" -e "bill" -e "dave" * grep Search the current folder for all files, containing the string "joe", "bill" or "dave".
254. bzgrep -e "joe" -e "bill" -e "dave" * grep-bz Search compressed or zipped file. Same syntax as grep. Search current folder for all files, containing the string "joe", "bill" or "dave".
255. man ls help Show the documentation for the command ls from the online manual
256. man -k hostname help Show all documentation relating to the keyword "hostname" from the online manual
257. ls -help help Display help for the command ls
258. ls --help help Display help for the command ls on some Linux systems.
259. compressdir joe hp-unix Compress all items in directory named Joe.
260. ls -la | sort -5 | pg hp-unix Show a directory listing sorted by column 5 size, and pause at the end of each page.
261. ls -la | sort -nrk5 | pg hp-unix Show a directory listing sorted by descending file size and pause at the end of each page. Sort options are "-n" for numeric sort, "r" for reverse order sort and "k5" for sort by column 5 or file size.
262. mach hp-unix Show cpu type.
263. kill -9 7777 kill Kill process with a PID or Process ID of 7777. The "-9" option is a forced kill.
264. kill -9 7777 5555 4444 kill Kill multiple processes with a Process ID of 7777, 5555 and 4444. The "-9" option is a forced kill.
265. lftp --version lftp Show version of the lftp the sophisticated file transfer program.
266. lftp --help lftp Show help for lftp the sophisticated file transfer program. Lftp can handle ftp, ftps, http, https and hftp.
267. lftp -f joe.lftp lftp Run lftp using the script file named joe.lftp.
268. ls -la ls Show a detailed directory listing of the current directory.
269. ls -lat ls Show a detailed directory listing of the current directory by descending date/time modified.
270. ls -lit ls Show a directory listing of the current directory with the latest modifed files on top.
271. ls -lia ls Show a detailed directory listing of the current directory, including the i-node.
272. ls -1 ls Show a directory listing of the current directory, with file name only, in a single column format.
273. ls -b ls Show a directory listing of the current directory, showing file names with all non-printable characters.
274. ls -lia /tmp ls Show a detailed directory listing of the directory /tmp.
275. ls -Ri /tmp ls Show a recursive directory listing of the directory /tmp showing i-nodes.
276. ls -alg ls Show a detailed recursive directory listing of the current directory. The "g" option also shows all hidden files.
277. ls -la usa*.gpg ls Show file listing of all files with a prefix of "usa" and a suffix of ".gpg". In the current directory.
278. ls -la *FEB09* ls Show file listing of all files with "FEB09" anywhere in the filename in the current directory.
279. ls | sort | pg ls Show a sorted directory listing and pause at the end of each page
280. ls | sort -r | pg ls Show a reverse sorted directory listing and pause at the end of each page
281. ls -laS | more ls Show a directory listing sort by descending file size, and pause at the end of each page.
282. ls -laSr | more ls Show a directory listing reverse sort by ascending file size, and pause at the end of each page.
283. ll ls Show a directory listing of the current directory, same as ls -la. Available on some systems only.
284. ll .. ls Show a directory listing of the directory, up one level from the current directory. This command is same as ls -la ... Available on some systems only.
285. sync memory Force write requests in cache to be written to disk.
286. free memory Show system memory usage in kilobytes.
287. free -m memory Show system memory usage in megabytes.
288. free -mt memory Show system memory usage in megabytes with a total line.
289. ipcs -s memory Show Semaphore identifiers in use.
290. ipcs -mop memory Show shared memory segments in use.
291. ipcrm -m 13245 memory Remove shared memory segment 13245
292. date; pwd; ls -la misc Join multiple commands together and display the results. Use the ";" character as the seperator.
293. dd misc Misc options to copy and format a files contents during the copy.
294. arch [-k | archname ] misc Display the architecture of the current host.
295. mkdir -p /temp/joe/workfile mkdir Make a directory named workfile. The "-p" option creates the complete directory path "/tmp/joe" if it is missing.
296. mkdir temp mkdir Make a directory named temp.
297. mkdir temp temp2 temp3 mkdir Make multiple directories named temp, temp2 and temp3.
298. mv file1 file2 move Move or rename file1 to file2
299. 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.
300. 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.
301. mv -i joe.txt /opt/vendor move Moves the flle named "joe.txt" from the current directory to the directory /opt/vendor". You must cd to the directory with "joe.txt" before issuing this command. The "-i" option makes sure you do not overwrite an existing file.
302. mv -iv temp ../temp_hold move Moves the directory "temp" from the current directory, up one level to the directory "temp_hold". The "v" option shows what is being moved.
303. mkfifo mypipe1 named pipeline Create a named pipeline named "mypipe1" in your current directory. A pipeline allows data to be passed from one application to another without a temporary file.
304. rm mypipe1 named pipeline Delete a named pipeline named "mypipe1". Pipelines can be deleted as any other file.
305. ls > mypipe1 (from sessions #1)
cat mypipe1 (on session #2)
named pipeline This process will send the output from an "ls" command from session #1 to Session #2. Session #1 will wait until Session #2 reads the pipeline data using a command such as the "cat". Both of these commands must be run from the directory that the named pipeline "mypipe1" is accessible.
306. ip addr network Display current network connections.
307. hostname network Display the name of your computer.
308. hostname galaxy501 network Set your computer name to "galaxy501".
309. traceroute www.webelink.com -l network Trace the route of network packets to the site www.webelink.com.
310. route network Display the routing table
311. 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).
312. nslookup www.webelink.com network Query your default domain name server (DNS) for an Internet name or IP address of "www.webelink.com"
313. dig www.webelink.com network-dig DNS lookup utility to get info on website "www.webelink.com". This is a very verbose output.
314. dig +short www.webelink.com network-dig DNS lookup utility to get info on website "www.webelink.com". A shorten version and only returns an ip address or null if the domain is invalid. This command is useful to verify domain names.
315. dig -x 999.999.999.999 network-dig DNS lookup utility to get info on IP: 999.999.999.999
316. ifconfig network-ifconfig Display all active network interfaces only. Shows the ip address and properties.
317. ifconfig -a network-ifconfig Display all network interfaces interfaces. Shows the ip address and properties.
318. ifconfig eth0 network-ifconfig Display information for the eth0 network interface.
319. netstat -an network-netstat Display the status information of the current network.
320. netstat -a network-netstat Display the status information for network sockets.
321. netstat -a | grep fastserve network-netstat Display the status information for inet service named "fastserve".
322. nmap www.webelink.com network-nmap Show open ports on the server located at www.webelink.com
323. nmap 999.999.999.999 network-nmap Show open ports on IP: 999.999.999.999.
324. nmap -sT 127.0.0.1 network-nmap Show open ports on your local pc.
325. nmap -A -T4 localhost network-nmap Show information about your localhost and all open ports.
326. nmap -sT -p 443 localhost network-nmap Check if port 443 is open on your localhost.
327. nmap -sV localhost network-nmap A more aggressive scan of what versions of services are running on your localhost.
328. nmap -sP 192.168.0.1-255 network-nmap Scan your network ip range from 192.168.0.1 to 192.168.0.255 and report what is running.
329. ping www.webelink.com network-ping Ping the host www.webelink.com continuously. Type control "c" to break out of ping.
330. ping -a www.webelink.com network-ping Ping the host www.webelink.com continuously. The "-a" will sound the audible alarm on each ping. Type control "c" to break out of ping.
331. ping -i 5 999.999.999.999 network-ping Ping the host 999.999.999.999 continuously, waiting 5 seconds between each packet sent. Type control "c" to break out of ping.
332. ping www.webelink.com -c 1 network-ping Ping the host www.webelink.com only once. The IP address will be returned.
333. ping 127.0.0.1 network-ping Check whether the local network interface is up and running. Type control "c" to break out of ping.
334. ping localhost network-ping Check whether the local network interface is up and running. Type control "c" to break out of ping.
335. ping -f localhost network-ping Flood the localhost with hundreds of pings per second. You must be a super user. Type control "c" to break out of ping.
336. ping -i 0.1 127.0.0.1 network-ping Flood the localhost with pings with less than a second between pings. You must be a super user to run pings with less than 1 second intervals. Type control "c" to break out of ping.
337. wget ftp://ftp.ruby-lang.org/pub/ruby.tar.gz network-wget Command line downloader. Get file "ruby.tar.gz" and save it in the current directory as "ruby.tar.gz"
338. wget www.webrpt.com/index.htm network-wget Command line downloader. Get file "index.htm" from the site "www.webrpt.com" and save it in the current directory
339. wget www.webrpt.com/index.htm -nv network-wget Command line downloader. Get file "index.htm" from the site "www.webrpt.com" and save it in the current directory. The option "-nv" is for non verbose which is the default.
340. wget www.webrpt.com/index.htm -q network-wget Command line downloader. Get file "index.htm" from the site "www.webrpt.com" and save it in the current directory. The option "-q" is for quiet mode with no status reporting.
341. wget www.webrpt.com/index.htm -O joe network-wget Command line downloader. Get file "index.htm" from the site "www.webelink.com" and save it in the current directory as file "joe"
342. wget www.webrpt.com/index.htm -O - network-wget Command line downloader. Get file "index.htm" from the site "www.webelink.com" and display it on your screen display. The "-" option re-directs the output to (stdout).
343. 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.
344. passwd password Change your login password.
345. passwd joe password Change login password for user joe.
346. /opt paths Home directory for 3rd party software.
347. /usr/local/bin paths Home directory for custom or user scripts and binaries. Should be copied for all system migrations.
348. /etc paths Unix configuration files.
349. /etc/crontab paths-cfg Crontab schedules for all users.
350. /var/spool/cron/atjobs paths-cfg Scheduled "at" jobs for all users.
351. /etc/passwd paths-cfg List of all system users.
352. /var/logs paths-cfg Numerous log files for Samba, mail, cron and misc.
353. /etc/profile paths-cfg Global default, or system default for all user login profiles. Note that this file name is "profile" not ".profile".
354. /home/joe/.profile paths-cfg Default login profile for user "joe". System profile "/etc/profile" is run prior to the user profile "/home/etc/.profile".
355. /bin/init.d paths-cfg Folder contains Unix boot and shutdown scripts.
356. /etc/sudoers paths-cfg File controls who can run restricted commands.
357. /etc/ssh/ssh_config paths-cfg File contains (SSH) Secure Shell options.
358. /var/adm/syslog/sys.log paths-cfg-hp System error log on HP-UX Unix.
359. perl -v perl Check if the "perl" scripting programs are installed, this command will show the current version number.
360. chmod 764 temp permission Change file or folder named temp permissions to -rwx rw- r--. Owner has read, write & execute (rwx) access, Group has read / write (rw-) access, Others have only read access (r--).
octal 7 = binary 111 = rwx
octal 6 = binary 110 = rw-
octal 5 = binary 101 = r-x
octal 4 = binary 100 = r--
octal 3 = binary 011 = -wx
octal 2 = binary 010 = -w-
octal 1 = binary 001 = --x
octal 0 = binary 000 = ---
361. chmod 777 temp permission Change file temp permission to allow full access -rwx rwx rwx.
362. chmod 777 * permission Change all files in current dir for full permissions.
363. chmod -R 777 /usr/temp permission Change all files recursively under the directory /usr/temp to full permissions.
364. chmod -R 777 /usr/acct/PORT.*/trans permission Change all file named trans recursively under all derectories with a prefix of PORT. to full permissions -rwx rwx rwx
365. chmod 775 joe permission Change file name joe to be executable by all users.
366. chmod 700 temp permission Change file named temp to be fully accesible by the file owner only.
367. chmod 770 temp permission Change file named temp to be group accesible -rwx rwx ---. Owner and Group have full access, all others are denied access
368. chmod 755 temp permission Change file named temp to be public access -rwx r-x r-x. Owner can read, write & execute, Group and all others can only read & execute.
369. chmod 666 temp permission Change file named temp to be -rw- rw- rw-. Everyone can read and write this file, but no body can execute it.
370. chmod 664 temp permission Change file named temp to be -rw- rw- r--. Owner and group can read and write, all other may only read.
371. chmod 660 temp permission Change file named temp to be -rw- rw- ---. Owner and Group can only read and write, all others have no access. No execute permissions.
372. chmod 440 temp permission Change file named temp to be -r-- r-- ---. Owner and Group can only read the file, all others have no access. No execute permissions.
373. chgrp payroll * permission-grp Change all file groups to group payroll.
374. chgrp -R accounting * permission-grp Change all files in the current directory and sub-directories to group "accounting".
375. groups permission-grp Show list of all valid user groups on system, ie. root bin daemon sys adm disk wheel.
376. groups joe permission-grp Show list of all user groups that user "joe" belongs to, ie. Joe: joe uvadm.
377. chown joe accounting permission-own Change the owner of file joe to the owner accounting.
378. chown cook * permission-own Change all file owners to owner cook in the current directory.
379. chown cook ytd* qtr* permission-own Change all file owners, which have a file name prefixed by "ytd or "qtr", to owner cook in the current directory.
380. chown cook -R /usr/users/ permission-own Change all file owners to cook recursively under the directory /usr/users
381. chown -R joe * permission-own Change all files in the current directory and sub-directories to owner "joe".
382. chown -R uvsql:accounting joe permission-own Change all files in the directory joe to owner uvsql and group accounting. The "-R" option is for recursive.
383. chown -R uvsql:accounting joe* us* permission-own Change all files or directories with a prefix of joe or with a prefix of us to owner uvsql and group accounting. The "-R" option is for recursive.
384. umask permission-um Show active mask to set permissions for newly created files. This is the octal format.
385. umask -S permission-um Show active mask to set permissions for newly created files. This is the symbolic format.
386. umask 000 permission-um User file-creation mask to set permissions for newly created files. (777-000) = 777 (drwxrwxrwx) for directories & 777 (rwxrwxrwx) for files .
387. umask 002 permission-um (Linux Default Regular User) User file-creation mask to set permissions for newly created files. (777-002) = 775 for directories & 664 for files.
388. umask 022 permission-um (Linux Default root User) User file-creation mask to set permissions for newly created files. (777-022) = 755 (drwxr-xr-x) for directories & 644 (-rw-r-r--) for files.
389. umask 007 permission-um User file-creation mask to set permissions for newly created files. (777-007) = 770 for directories, 660 for files.
390. umask 027 permission-um User file-creation mask to set permissions for newly created files. (777-027) = 750 (rwxr-x---) for directoties and 640 (rw-r-----) for files.
391. umask 077 permission-um (Secure) User file-creation mask to set permissions for newly created files. (777-077) = 700 (drwx------) for directories and 600 (-rw------) for files. (owner-group-other)
392. rpm -qi php php scripting Show the version of php scripting language.
393. lpstat -a printing Show all printer queues with status and printer names.
394. lpstat -t printing Show all info on printers and print queues.
395. cancel 7210 printing Cancel print job# "7210".
396. lpstat hp101 printing Show all print jobs on printer "hp101" and the printer status.
397. ls -l | lp -d hp101 printing Send a directory listing to a printer named "hp101".
398. man ftp | lp -d hp101 printing Send the man pages document for ftp to a printer named "hp101".
399. cat joe.txt | lp -d hp101 printing Send the text file named joe.txt to a printer named "hp101".
400. lp -d hp101 joe.txt printing Send the text file named joe.txt to a printer named "hp101".
401. enable hp101 printing Activates a printer named "hp101", this enables the printer to accept print requests issued by the lp command.
402. 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.
403. cat rpt501.txt | unix2dos | lp -d hp101 -o raw printing Send a unix text file named "rpt501.txt" to a printer named "hp101", pipe it thru "unix2dos" to correct all <cr><lf> sequences, and send the raw un-modified data to the printer.
404. export PS1="[${LOGNAME}@$(hostname)] # " prompt Set PS1 shell variable for the command line prompt to be "[Login ID @ host name]" such as "[joe@LinuxSvr]".
405. 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".
406. export PS2="#" prompt Set PS2 shell variable for the command line secondary prompt variable. The default is ">".
407. rmdir temp purge Remove or Delete the directory temp if it is empty.
408. 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.
409. 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".
410. 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 "run in the background Linux command".
411. 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.
412. rm cust55 purge Remove the file named cust55 from the current directory
413. rm TRAN*.Z purge Remove all files with a prefix of "TRAN" and a suffix of ".Z" in the current directory.
414. 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
415. find /tmp -name core -type f -print0 | xargs -0 rm -f purge Find and purge all files named "core" in or below the directory /tmp. This format properly handles files containing spaces or newlines in the filename.
416. 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.
417. cat filelist.txt | xargs rm -f purge Purge all files contained in the file "filelist.txt". The "-f" option suppresses confirmation prompts. Xargs will run fast due to running multiple threads.
418. 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.
419. python -V python Check if the "python" scripting programs are installed, this command will show the current version number.
420. ls -lia > /tmp/filelist redirect (stdout) Show the directory listing saving the output text in a file named /tmp/filelist.
421. 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.
422. grep joe 2> grep-errors.txt redirect (stderr) Save the stderr output of the grep program to a file named "grep-errors.txt".
423. grep joe 1> &2 redirect (stdout) Write the stdout of the grep program to a "stderr".
424. grep joe 2> &1 redirect (stderr) Write the stderr of the grep program to a "stdout".
425. /usr/local/bin/status > /dev/null 2>&1 redirect Run the program "status", redirect the output to /dev/null sending standard output and standard error to /dev/null. Basically, throw away all output from the "status" command.
426. 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".
427. ls | rev rev show a directory listing and reverse all files names, ie. file name "joe.log" will reverse to "gol.eoj". Useful in scripts that need to extract file extensions from multi delimited file names, with variable length strings.
428. rev /tmp/joe.txt rev Display the file "/tmp/joe.txt" to the standard output device and reverse each line in this file.
429. rmdir -R temp rmdir Delete directory named temp. The "-R" option purges all folders and files under the directory "temp" recursively.
430. rsync *.z svrdb:tmp/ rsync Transfer all files with a suffix of ".z", from the current directory, to a server named "svrdb" to a folder named "/tmp". For existing files, only the differences will be sent.
431. rsync -avz svrdb:reports/dec /data/tmp rsync Recursively transfer all files from server "svrdb" from folder /reports/dec to a local folder "/data/tmp". Files are transferred in "archive" mode, which preserves symbolic links, permissions and ownerships. Compression will be used for the transfer. The option "a" is for archive, "v" is for verbose and "z" is for compression.
432. rsync -avz --del svrdb:reports/dec /data/tmp rsync Recursively transfer all files from server "svrdb" from folder /reports/dec to a local folder "/data/tmp". Files are transferred in "archive" mode, which preserves symbolic links, permissions and ownerships. Compression will be used for the transfer. The "--del" option will delete all files in the folder "/data/tmp" which do not exist in the source folder "reports/dec".
433. rsync -avz /usr/rpts root@10.201.5.8:/usr/trans rsync Recursively transfer all folders and files from the path /usr/rpts to a remote server at 10.201.5.8, using the root user id on the remote server, to a remote folder "/usr/trans". Files are transferred in "archive" mode, which preserves symbolic links, permissions and ownerships. Compression will be used for the transfer. The remote folder "/usr/trans/" must exist.
434. smbd -i samba Run Samba in interactive mode.
435. smbd -D samba Run Samba as a Daemon. Provides SMB/CIFS services to clients.
436. smbd -V samba Show Samba version number.
437. ps -ef | grep smb samba Check if Samba Daemon is currently running.
438. service smb restart samba Restart the Samba Daemon.
439. sar sar Display today's CPU activity so far. The information must be present on the computer.
440. sar -A sar Displays real time CPU activity for all items.
441. sar -c sar Displays real time CPU activity for system calls.
442. sar -d sar Displays real time CPU activity for block devices such as tape or disk.
443. sar -g sar Displays real time CPU activity for paging.
444. sar -k sar Displays real time CPU activity for kernel memory allocation (KMA).
445. sar -m sar Displays real time CPU activity for message and semaphore activities.
446. sar -q sar Displays real time CPU activity for average queue length while occupied, and percent of time occupied.
447. sar -r sar Displays real time CPU activity for unused memory pages and disk blocks.
448. sar -u sar Displays real time CPU utilization (the default).
449. sar -v sar Displays real time for status of process, i-node and file tables.
450. sar -w sar Displays real time for system swapping and switching.
451. sar 3 5 sar Displays 5 snapshots, every 3 seconds, of the current system io load.
452. scp *.pl joe@10.1.5.5:/home/scripts scp Secure copy function to 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.
453. scp -rp -C Acct2011 root@10.1.5.5:/temp scp Secure copy the directory "Acct2011" to a remote server at IP "10.1.5.5" for user "root", to the directory "/temp". The "r" option is for a recursive copy of all folders and files. The "p" option is to preserve current file permissions. The "C" option is to compress files during transfer. This is a secure copy and SSH needs to be installed on both systems.
454. scp root@10.1.5.5:joe.tar . scp Secure copy function to copy the file "joe.tar" from a remote server at IP "10.1.5.5" for user "root", to the current directory.
455. #!/bin/ksh scrip -code 1st line in script, use korn shell for all commands in this script.
456. #!/bin/bash script code 1st line in script, use bash shell for all commands in this script.
457. echo $? script code Exit status of last shell command executed. A "0" is returned if the last command was successful or a some error# if un-successful.
458. echo $$ script code Show your current session PID (process id). A useful unique id for creating temporary file names.
459. echo $(pwd) script code Show your current working directory.
460. echo $(basename $(pwd)) script code Show only your current directory from your full current path. For example return "joe" from the path "/opt/vendor/joe".
461. #while date; do sleep 10; done script code Shell script to run a continuos loop and display the system date every 10 seconds.
462. exit 115 script code Exit the current script and return an exit code of "115" to the shell.
463. exit 1 script code Exit the current script and return an exit code of "1" to the shell.
464. account='joe'; echo $account script code Shell script to set variable "account" to the value "joe", then echo back the variable "account" to std out.
465. read txt1 script code Shell script to read std in (keyboard input) and store it in a variable named "txt1". The command echo $txt1 will show the current value stored.
466. script security-script Log user activity, keyboard entry and outout, saving in a default log file named typescript. Type "exit" to exit logging.
467. script -a joe.ulog security-script Log user activity, keyboard entry and outout, saving in a log file named joe.ulog. Type "exit" to exit logging.
468. script -c ksh security-script 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.
469. set stty erase {bs} set Set your backspace key for your process by entering the {bs}.
470. /bin/ksh shells Korn Shell (most popular with Unix systems)
471. /bin/bash shells Bash Shell (most popular with free Linux systems)
472. /bin/csh shells C-Shell
473. /bin/sh shells Bourne shell, standard default Shell.
474. shutdown -h 0 shutdown Shutdown now on Red Hat Linux. Halt after shutdown.
475. shutdown -h now shutdown Shutdown now on Red Hat Linux. Halt after shutdown.
476. sudo shutdown -h 0 shutdown Shutdown now on Debian or Ubuntu Linux. Halt after shutdown.
477. shutdown -r now shutdown Shutdown now on Red Hat Linux. Restart system after shutdown.
478. sleep 5 sleep Sleep for 5 seconds.
479. sleep 5s sleep Sleep for 5 seconds.
480. sleep 5m sleep Sleep for 5 minutes.
481. sleep 2h sleep Sleep for 2 hours.
482. sleep 3d sleep Sleep for 3 days.
483. sudo apt-get install chkconfig software apt-get Install of "chkconfig" services utility on Debian or Ubuntu Linux.
484. sudo apt-get install di software apt-get Install of "di" disk utility command software on Debian or Ubuntu Linux.
485. sudo apt-get install ksysguard software apt-get Install ksysguard, allows you to monitor various statistics about your system.
486. sudo apt-get install nmap software apt-get Install nmap, a network exploration and security tool with open port scanner.
487. sudo apt-get install konsole software apt-get Install konsole, free terminal emulator for the KDE Desktop Environment.
488. sudo apt-get install ruby software apt-get Install of "Ruby" scripting software on Debian or Ubuntu Linux.
489. sudo apt-get install bvi software apt-get Install of "bvi" visual editor for binary files software on Debian or Ubuntu Linux.
490. sudo apt-get remove bvi software apt-get 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.
491. sudo apt-get --purge remove bvi software apt-get Complete removal of package "bvi" visual editor for binary files software on Debian or Ubuntu Linux. Software and configuration files will be purged.
492. sudo apt-get install openssh-server apache2 software apt-get Install of "open ssh server" and "apache2" software on Debian or Ubuntu Linux.
493. sudo apt-get update software apt-get 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.
494. sudo apt-get -u upgrade software apt-get 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.
495. sudo apt-get install ubuntu-desktop software apt-get Install of Ubuntu GUI Desktop software on Debian or Ubuntu Linux. This is a way to install desktop software on the server version.
496. sudo apt-get install -f software apt-get Run this command after a failed "apt-get install" to get all missing packages or software. Then re-run the original install program.
497. rpm -q centos-release software rpm Show your version of Linux. Release 5.6 will show "centos-release-5-6.el5.centos.1"
498. rpm -q rsync software rpm Show the current version of rsync on your server. For example "rsync-3.0.6-4.el5_7.1".
499. rpm -qa software rpm List all installed ".rpm" software packages.
500. rpm -qi rsync software rpm Show information on the installed package "rsync".
501. rpm -ql rsync software rpm Show all the files that package "rsync" installed on your system.
502. rpm -ivh package-version.rpm software rpm Install the software package "package-version.rpm" on your system. Only the "-i" option is required. The "v" option is for verbose messages and the "h" will show hash marks while the package is unpacked.
503. rpm -Uvh package-version.rpm software rpm Upgrade installed software package "package-version.rpm" on your system.
504. rpm --rebuild package-version.src.rpm software rpm Install the source "rpm" package "package-version.rpm" on your system.
505. rpm -e rsync software rpm Remove the installed software package "rsync" from your system.
506. rpm --rebuilddb software rpm Rebuild the "RPM" database.
507. yum cvs search software yum Show a list of software downloads available for "cvs".
508. yum list update software yum Get the latest list of updates for your Linux Distribution.
509. yum list <program name> software yum Show version of the software, named installed on your Linux system.
510. yum list installed software yum Show all the software installed on your Linux system.
511. yum list installed | grep ftp software yum Show all the "ftp" programs installed on your Linux system.
512. yum update software yum Get the latest Linux Distribution updates.
513. yum install ncompress software yum Install, using yum software, the compress and uncompress utility programs.
514. yum install php software yum Install, using yum software, the php scripting language programs. PHP is well suited for web development projects.
515. yum install sysstat software yum Install, using yum software, the sar utility to monitor system performance. You need to run the following two commands to initialize sar for 1st time use "/usr/lib/sa/sa1 1 1" and "/usr/lib/sa/sa2 -A".
516. yum install system-config-lvm software yum Install, using yum software, the LVM Logical Volume Magement for the graphical interface.
517. yum install vsftpd software yum Install sftpd (Very Secure FTP Daemon) an FTP server for Linux systems. Supports IPv6, SSL and many other advanced features.
518. ls -lia | sort -r sort Issue the list directory command and do a reverse sort on the output.
519. sort temp.lst sort Sort the contents of the file "temp.lst" by an alpha order.
520. sort -n temp.lst sort Sort the contents of the file "temp.lst" by a numerical order.
521. split -l 700 access.log split Split the file "access.log" into smaller files of less than 700 lines for each file.
522. split -b 1400000 access.log split Split the file "access.log" into smaller files, of less than 1.4kb bytes per file, to fit on 1.44 MB floppies. Files will be named xaa thru xzz.
523. cat x* > access2.log split Rejoin all split files into a single file named "access2.log".
524. ssh 10.x.x.x ssh Make an SSH Secure Shell Connection to ip: 10.x.x.x login as default user.
525. ssh root@10.x.x.x ssh Make an SSH Secure Shell Connection to ip: 10.x.x.x login as user root.
526. ssh joe@10.x.x.x "uname -a; ls -la" ssh Make an SSH Secure Shell Connection to ip: 10.x.x.x login as user joe, run the command"uname -a", "ls -la" and logoff.
527. ssh -o TCPKeepAlive joe@10.x.x.x ssh Make an SSH Secure Shell Connection to ip: 10.x.x.x login as user joe, sending null keep alive packets if no traffic is present.
528. 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.
529. 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.
530. cat ~/.ssh/config ssh Show your ssh configuration from your home directory. "~" is the same as "/home/joe" for the user "joe". Certificates are stored in the folder "/home/joe/.ssh".
531. /usr/sbin/sshd ssh Launch SSH Daemon which is required to make new ssh connections. This background daemon must be running at all times.
532. service sshd restart ssh Restart the SSH Daemon.
533. 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".
534. 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".
535. 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.
536. 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.
537. stty -a stty Show all shell terminal properties.
538. stty -g stty Show all shell terminal properties in a format that can be passed to another stty command.
539. stty columns 212 stty Set the current shell terminal width to 212 columns.
540. stty sane stty Reset all shell terminal properties to resonable defaults as a starting point.
541. ln -s /usr/joe/db /joe/db symbolic link Create a symbolic link for /joe/db to point to /usr/joe/db.
542. unlink /joe/db symbolic link Delete symbolic link /joe/db.
543. ln -s tmp joe symbolic link Create a symbolic link for joe to point to tmp directory.
544. ls -l tmp joe symbolic link Display a directory listing of "joe" showing that a sybolic link is set for "joe > tmp".
545. touch -version /temp/joe.txt touch Output the version information only and exit for the file named /temp/joe.txt.
546. touch -a /temp/joe touch Change the file access time on the file named /temp/joe.
547. touch -m /temp/joe.txt touch Change the file modification time on the file named /temp/joe.txt.
548. touch joe.txt touch Create an empty file named joe.txt in the current directory. If the file exists, then the modification date and time will be set to the system date and time.
549. tr -d '\0' < joe.txt > newfile Translate Delete all null characters from a file named "joe.txt" and save a new file named "newfile".
550. 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.
551. 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.
552. 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"
553. tr -d '[:print:]' > joe_new.txt Translate Select all printable characters from a file named "joe.txt" and save them in a new file named "joe_new.txt"
554. tr -d '[:alpha:]' > joe_new.txt Translate Select all letters only from a file named "joe.txt" and save them in a new file named "joe_new.txt"
555. tr -d '[:digit:]' > joe_new.txt Translate Select all numerical digits only from a file named "joe.txt" and save them in a new file named "joe_new.txt"
556. tr -d '[:alnum:]' > joe_new.txt Translate Select all letters and digits from a file named "joe.txt" and save them in a new file named "joe_new.txt"
557. tr -d '[:cntrl:]' > joe_new.txt Translate Select all control characters only from a file named "joe.txt" and save them in a new file named "joe_new.txt"
558. 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.
559. 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".
560. 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".
561. 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".
562. uuencode -m newfile myfile > mfile.uue uuencode Create a uue encoded file "myfile.uue" from the file "myfile". The filename "newfile" will be the header created for decoding. The "-m" option forces "base64" encoding.
563. uudecode myfile.uue uuencode Decode the uue encoded file "myfile.uue". The file name will come from the header line, ie. "begin 850 newfile".
564. vi joe.txt vi editor Open the file "joe.txt" with the standard Linux vi editor.
565. vi + joe.txt vi editor Open the file "joe.txt" with the standard Linux vi editor and start on the last line.
566. vi +300 joe.txt vi editor Open the file "joe.txt" with the standard Linux vi editor and start on line 300.
567. vi -r joe.txt vi editor Recover the file "joe.txt" from the last crashed "vi" session.
568. vncserver vnc Start a new instance of a vnc server, number 1-x. You can access by the ip address x.x.x.x:y where y is the instance number, ie. 10.1.5.5:1 for the first instance.
569. vncserver -kill :1 vnc Stops instance ":1" of a running vnc server.
570. vncserver -kill :2 vnc Stops instance ":2" of a running vnc server.
571. which joe.sh which Show the full path of the shell comand "joe.sh", by searching for the first directory in your environment variable $PATH. This is the command which is currently active.
572. which --all mailx which Show the full path of the shell comand "mailx", by searching all directories in your environment variable $PATH. All paths and links found will display.
573. cat text.txt | wc word count Count words in the file named test.txt.
574. 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.
575. find /tmp -name core -type f -print0 | xargs -0 rm -f xargs Find and purge all files named "core" in or below the directory /tmp. This format properly handles files containing spaces or newlines in the filename.
576. find . -type f -name "2008*" | xargs rm -f xargs Find and purge all files with the file name starting with"2008" from the current directory. The "-f" option suppresses confirmation prompts. Xargs will run fast due to running multiple threads.
577. find / -type f -mmin -90 | xargs -r ls -l xargs Search the entire system for files that were modified in the last 90 minutes. The "-r" option tells xargs to not issue "ls -l" if no files were found.
578. startx xwindows Start x windows.
 © Copyright 2003-2013 webelink.com. All Rights Reserved.   | Click to Email for Info | Terms of Use |