CENG 303 Basic Unix Information - Rice U.Page 1 of 2 CENG 303 Rice University Basic Unix Information All workstations here at Rice are Unix based. To be efficient in a Unix system, you need to know a few basic commands listed in the following Tables. To get more detailed information, see the Unix documents at: Introduction to the Unix Operating System on IT Systems has descriptions of many useful commands, Information Technology Document Index is the parent directory to many such documents. An extensive set of on-line documents may also be found at Indiana University's Indiana University Knowledge Base. The following tables list the UNIX commands that you will find most useful in your courses. Note that the links that formerly led to information about these commands are not supplied. You may use the Rice pdf document to find information about each command or search for it at Indiana. Table 1 of Unix Commands command login logout or exit man ls cat more lpr lprloc lpq lprm passwd which performs Login prompt at a workstation or X terminal. Ending a Unix session. example(s) servernm login: yourid servernm% logout gives help information about commands, frequently this is server% man passwd very detailed and long lists file and directory names; long form gives details about the objects; long form and ordered by date lists contents of a file lists contents of a file, but gives one screenful at a time. prints contents of a file to your default printer print file to designated printer lists the printers and designates your default printer display the queue of printer jobs on your default printer removes a print job you submitted allows you to change your password determines where an executable is located in your path server% ls server% ls -l server% ls -lt server% cat filenm server% more filenm server% lpr filenm server% lpr filenm Palb223 server% lprloc server% lpq server% lprm 10 server% passwd server% which lpr Table 2 of Unix Commands http://www.owlnet.rice.edu/~ceng303/unix.html 16.08.2002 rice.owlnet.edu/~ceng303/unix. Page 2 of 2 Command Performs change directories change to your home directory remove (delete) one or more file(s) Example(s) server% cd /home/ceng303 server% cd server% rm filenm server% rm file* server% mv filenm newnm server% mv filenm dirnm server% mkdir dirnm server% rmdir dirnm server% pwd server% ps server% kill 29973 server% cd ~ceng301 same as: server% cd /home/ceng301 server% ls file? server% ls file* cd rm mv mkdir rmdir pwd ps kill ~ ? * move (rename) one or more files create a new directory delete an empty directory determine the complete name of the current directory. Return to CENG 303 homepage http://www. Get more information about a user.Rice U.08. terminate a process "home of" applied to a directory wild card for one character wild card for any number of characters Table 3 of Unix Commands Command chmod diff grep Performs Change file or directory permissions Compare contents of two files Look for a string in one or more files Example(s) server% chmod g-r server% diff file1 file2 server% grep ceng303 filenm server% grep 'is it not' file* server% finger ceng301 server% finger shdavis@moe finger Determine whether a user has an Owlnet account.CENG 303 Basic Unix Information .2002 . list the status of current processes running on your server and give id numbers for each.html 16.