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

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;
long form gives details about the objects;
long form and ordered by date

server% ls
server% ls -l
server% ls -lt

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
print file to designated printer

server% lpr filenm
server% lpr filenm -Palb223

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

Table 2 of Unix Commands

Command

Performs

Example(s)

cd

change directories
change to your home directory

server% cd /home/ceng303
server% cd

rm

remove (delete) one or more file(s)

server% rm filenm
server% rm file*

mv

move (rename) one or more files

server% mv filenm newnm
server% mv filenm dirnm

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:
server% cd /home/ceng301

?

wild card for one character

server% ls file?

*

wild card for any number of characters

server% ls file*

Table 3 of Unix Commands

Command

Performs

Example(s)

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
server% grep 'is it not' file*

finger

Determine whether a user has an Owlnet account; Get more information about a user.

server% finger ceng301
server% finger shdavis@moe

« 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