UNIX


Why learn UNIX? - because it's an essential skill. Although we don't directly teach UNIX during 1st year, you would be well advised to learn as much about it as you can.

Please mail cs1@ug.cs.usyd.edu.au if you find any of the links on this page are broken, or if you feel something should be added to this page.

 

The learn tutorials

In an xterm window, type the following (and hit the <Enter> key):
    learn
You should be presented with a menu of interactive tutorials available at Basser. Three of these are basic UNIX tutorials (unix, moreunix, advunix) which you should go through in your own time.

 

Minimum amount of UNIX you will be expected to know (by week 5 of 1st year)

Commands

Command What it does Common Usage
passwd Change your password passwd
ls List the contents ls
cd Change working directory cd <directory>
cp Copy a file cp <source filename> <target filename>
mv Move/rename a file mv <source filename> <target filename>
netfile Send a file netfile <login> <filenames>
netget Get a file sent to you netget
tar Take several files and put them into one file (similar to zip)
tar -cvf <tarfile> <filenames> (to create a tar file)
tar -xvf <tarfile> (to extract a tar file)
rm Remove a file rm <filenames>
mkdir Make a new directory mkdir <directory>
rmdir Remove a directory rmdir <directory>
chmod Change the permissions on a file/directory chmod <permissions setting> <filename>
pwd Present working directory pwd
man Get the manual page for a unix command man <unix command>OR tkman
grep Search for a pattern in a given file grep <pattern> <filenames>
find Search for a file (in the current working directory and the directories beneath it) find -name <filename>

Special characters

Character What it means Common Usage
.
The working directory (i.e. the directory given by the pwd command) cp -r ~cs1/lib/html/java/examples/code/lab1/ .
..
The directory above the working directory cd ..
~
Path shortcut cd ~<login>
*
Any characters (a wildcard)  
Tab key
Completes commands/paths (hit twice to see options)  
/
Path separator  

 

Protecting yourself

 

How to read a man page

Man pages are meant to be a quick reference guide. If you are a beginner and you want to learn UNIX, you're better off doing an online tutorial first.

First, a few useful commands to know when navigating man pages:

qQuit
Enter keyGo forward one line
Space barGo forward one page
bGo back one page
//pattern = Search (forwards) for
n/pattern = Find next occurrence of the pattern

OR

Use tkman which will give you a GUI view of the man pages

Before reading further, actually bring up the man page for the ls command (using either man or tkman)

A man page is split into sections (some of these may not be present, depending on the man page):

NAMESummarises what the command does
SYNOPSISHow to use the command (syntax)
DESCRIPTION A description of the command
OPTIONSThe options available
SEE ALSOThe names of related programs
EXAMPLESExamples of how to using the command
EXIT STATUS The exit status of the command (useful when writing shell scripts)
FILES A list of files that are used by and/or modified by the command
AUTHORSThe authors of the program
 

UNIX tutorials














































Page Created: 24th April, 2000
Last Modified: