1、Dr. Joseph Ng,Basic Unix commands (vs. DOS),cat file Concatenate or type out a filecat file1 file2 . Type out a number of files cd directory1 Change current directory to directory1cd /usr/bin Change current directory to /usr/bincd Change back to your home directory clear Clear the current screen cp
2、file1 file2 Copy file1 to file2cp file1 file2 . dir Copy a number of files to a directory ls List the files in the current directoryls /usr/bin List the files in the /usr/bin directory lpr file1 Print file1 out lpr file1 file2 . Print a number of files out more file Look at the content of a file wit
3、h paging, use q to get out mkdir directory Create a directory mv file1 file2 Move file1 to file2, like rename.mv file1 file2 . dir Move a number of files into a directorymv dir1 dir2 Move or rename a directory,Dr. Joseph Ng,rm file Remove a filerm file1 file2 . Remove a number of filesrm -r director
4、y Remove a directory include the sub-directory rmdir directory Remove a directory,Dr. Joseph Ng,Who, When, Why, What and Where?,man cp Display on-line manual for the “cp” commandman -k keyword Display manual help file related to the keyword passwd Change your login password pwd Display the path name
5、 of where you are uptime Tell you how long the machine has been up and running users Tell you who is logging in who Tell you who is logging-in in detail w Tell you who is logging in and doing what! whoami Show you the owner of this account finger user Find out the personal information of a userfinge
6、r name Try to find the persons info. by his/her namefinger email-address Try to find the persons info across the network write user Write a message on somebodys screen talk user Talk to the person logging in the same system with you talk email-address Talk to somebody logging in the network date Dis
7、play todays time and date cal year Display the calendar of the specified year (e.g. 1997),Dr. Joseph Ng,Capturing the Screen and File Conversion,You can use the “script” command to capture your output. By default, script will capture the output to a file called “typescript”. However, it is of DOS fo
8、rmat.%script%exit Use the following command to change a text file from Unix format to DOS format or vice versa: dos2unix unix2dos ,Dr. Joseph Ng,More Unix Commands,Here are some more unix commands: (not in any order) wc word count ps process status kill killing a process tar tape archive at run a co
9、mmand at a certain time cmp compare a file diff show the differences between 2 files sort sort or merge files line by line comm select common lines to 2 sorted files join combine 2 files by joining records with identical keys uniq remove successive duplicate lines from a file quot summarize file sys
10、tem ownership,Dr. Joseph Ng,More Unix commands, Utilities and Others,mkfile create a file touch modify the attribute of a file chmod change mode ln make links (symbolic links) more, less, tail display a file du disk usage df free space on disk nice run a command at low priority top system usage vi editor The use of find, grep, and awk What is a shell? Bourne Again Shell, sh, csh, tcsh, korn shell, etc What is system programming?,