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.
command |
Performs |
Example(s) |
---|---|---|
login |
Login prompt at a workstation or X terminal. |
servernm login: yourid |
logout or exit |
Ending a Unix session. |
servernm% logout |
man |
gives help information about commands, frequently this is very detailed and long |
server% man passwd |
ls |
lists file and directory names; |
server% ls |
cat |
lists contents of a file |
server% cat filenm |
more |
lists contents of a file, but gives one screenful at a time. |
server% more filenm |
lpr |
prints contents of a file to your default printer |
server% lpr filenm |
lprloc |
lists the printers and designates your default printer |
server% lprloc |
lpq |
display the queue of printer jobs on your default printer |
server% lpq |
lprm |
removes a print job you submitted |
server% lprm 10 |
passwd |
allows you to change your password |
server% passwd |
which |
determines where an executable is located in your path |
server% which lpr |
|
|
|
cd |
change directories |
server% cd /home/ceng303 |
rm |
remove (delete) one or more file(s) |
server% rm filenm |
mv |
move (rename) one or more files |
server% mv filenm newnm |
mkdir |
create a new directory |
server% mkdir dirnm |
rmdir |
delete an empty directory |
server% rmdir dirnm |
pwd |
determine the complete name of the current directory. |
server% pwd |
ps |
list the status of current processes running on your server and give id numbers for each. |
server% ps |
kill |
terminate a process |
server% kill 29973 |
~ |
"home of" applied to a directory |
server% cd ~ceng301 same as: |
? |
wild card for one character |
server% ls file? |
* |
wild card for any number of characters |
server% ls file* |
|
|
|
chmod |
Change file or directory permissions |
server% chmod g-r |
diff |
Compare contents of two files |
server% diff file1 file2 |
grep |
Look for a string in one or more files |
server% grep ceng303 filenm |
finger |
Determine whether a user has an Owlnet account; Get more information about a user. |
server% finger ceng301 |
« Return to CHBE 303 home page
Revised by Michail Stamatakis (mstam@rice.edu) and Sean McCudden (mccudden@rice.edu), 3 September 2006
© Rice University, Chemical and Biomolecular Engineering,, Copyright Notice