How to use Unix
UNIX for Beginners

Unix commands:

ls list files and directories
ls -a list all files and directories
mkdir make a directory
cd directory change to named directory
cd change to home-directory
cd ~ change to home-directory
cd .. change to parent directory
pwd display the path of the current directory
cp file1file2 copy file1 and call it file2
mv file1file2 move or rename file1 to file2
rm file remove a file
rmdir directory remove a directory
cat file display a file
more file display a file a page at a time
head file display the first few lines of a file
tail file display the last few lines of a file
grep 'keyword' file search a file for keywords
wc file count number of lines/words/characters in file
command > file
redirect standard output to a file
command >> file append standard output to a file
command < file redirect standard input from a file
command1 | command2 pipe the output of command1 to the input of command2
cat file1file2 > file0 concatenate file1 and file2 to file0
sort sort data
who list users currently logged in
a2ps textfile > psfile convert text file to postscript file
lpr -Pprinterpsfile print postscript file to named printer

Typographical Conventions

Introduction to The UNIX operating system

Step One

Listing files and directories
Making Directories
Changing to a different Directory
The directories . and ..
Pathnames
More about home directories and pathnames

Step Two

Copying Files
Moving Files
Removing Files and directories
Displaying the contents of a file on the screen
Searching the contents of a file

Step Three

Redirection
Redirecting the Output
Redirecting the Input
Pipes

Step Four

Wildcards
Filename Conventions
Getting Help

Step Five

File system security (access rights)
Changing access rights
Processes and Jobs
Listing suspended and background processes
Killing a process

Step Six

Other Useful UNIX commands

Typographical Conventions

In what follows, we shall use the following typographical conventions: So, for example,
% ls anydirectory[Return]
means "at the UNIX prompt %, type ls followed by the name of some directory, then press the key marked return"

Don't forget to press the [Return] key: commands are not sent to the computer until this is done.

Note: UNIX is "case-sensitve", so LS is not the same as ls .

The same applies to filenames, so myfile.txt, MyFile.txt and MYFILE.TXT are three seperate files. Beware if copying files to a PC, since DOS and Windows do not make this distinction.