SURVIVAL KIT FOR UNIX
INDEX
It is assumed here that you have an account with a username and a valid password and that you can handle a keyboard and a mouse.
1. General Stuff.
NB 1 : you need to move the cursor inside a shell to make the shell active before issuing a command.1.1 Creating shells
- go to the Desk 1 box located at the left top corner.
- select Tools and Shell .
- a shell appears wherever you click on the
screen
( Fig. 1 ).
1.2 Moving, Sizing shells
- move a shell by either:
- clicking and holding inside the shell's menu bar
- pressing Alt and F7 at the same time
- click with the right mouse button on the border and select Move .
- size a shell by either:
- clicking and holding inside the shell's window
- pressing Alt and F8 at the same time
- click with the right mouse button on the border and select Size .
- raise a shell by either:
- clicking and holding the outline of the shell's window
- pressing Alt and F1 at the same time
- click with the right mouse button on the border and select Raise .
- lower a shell by either:
- pressing Alt and F3 at the same time
- click with the right mouse button on the border and select Lower .
Warning : UNIX commands are case sensitive !
2. Directories.
The UNIX directory system looks like something in Fig. 2 :NB : you can get info on any command by typing man commandname.
2.1 Listing Directories and Files: ls
- ls : list all files by name
- ls -c : list all files on several columns
- ls -l : list all files with all info
- ls -al : list all files (hidden files included)
- ls .. : list parent's directory of working directory
- ls ../.. : list parent's parent directory of working directory
- ls -c : list all files on several columns
2.2 Creating Directories: mkdir
- mkdir dir1 : create directory
dir1
- mkdir dir1 /dir2: create subdirectory dir2 in directory dir1
2.3 Deleting Directories: rmdir
- rmdir dir1: remove directory
dir1
- rmdir dir1/dir2: remove subdirectory dir2 in directory dir1
2.4 Finding the Location of a Directories: pwd
- pwd : print pathname of the working directory
2.5 Changing Directories: cd
- cd dir1: change directory
- cd pathname / dir1: change directory
3. Files.
3.1 Wildcards: * ? [ ]
- ls e *: list all
files beginning with e
- ls e ?: list all files beginning with e followed by only one character
- ls [ aeiou ] file: list all files beginning with a vowel followed by file
- ls [ aeiou ]*: list all files beginning with a vowel
- ls [ a-m ]*: list all files starting from a to m
- ls e ?: list all files beginning with e followed by only one character
3.2 Copying Files: cp
- cp sourcefile destinationfile:
copy sourcefile to destinationfile
- cp /home/dir1/dir2/ sourcefile : copy sourcefile to current directory
- cp sourcefile /home/dir1/ dir2/destinationfile: copy sourcefile to /home/dir1/ dir2/ and name it destinationfile
- cp *.txt dir2: copy all files ending with .txt to dir2
- cp filename1 filename2 dir2: copy filename1 and filename2 to dir2
- cp /home/dir1/dir2/ sourcefile : copy sourcefile to current directory
3.3 Renaming Files: mv
- mv sourcefile destinationfile: rename sourcefile, destinationfile
3.4 Deleting Files: rm
- rm filename: remove filename
- rm dir1/old*: remove all files starting with old from dir1
- /rm -r filename: remove filename without asking you for a confirmation
- rm dir1/old*: remove all files starting with old from dir1
3.5 Reading Files: cat
- cat filename1 filename2 :
(ctrl-s: stops scrolling, ctrl-q:
resumes scrolling)
- pg filename: same as cat but display one screen at a time the content of filename (hit return to display next page; type q to get out)
4. Printing.
- lp filename: print filename on the Apple laserwriter
5. Ftp, Telnet.
Telnet allows you to connect you to another computer while ftp allows you to grab or copy files that sit on another computer.5.1 telnet
- telnet computer.address: connects
you to computer; enter your username
and password when prompted
- quit: ends the connection
5.2 ftp
- ftp computer.address: connects you
to computer; enter your username and
password when prompted
- bin: binary
- as: ASCII
- get filename: grab a file from the computer you made the connection to
- put filename: put a file into the computer you made the connection to
- bye: ends the connection
- bin: binary
These commands are a strict minimum to survive in VisLab. If you want to know more about UNIX, there is a manual somewhere in VisLab which gives a basic introduction to UNIX (you might have to do some research!).
Finally, if you have any problems (computer-related only!), shout HELP!!! and rescue should be under way within minutes in the person of Ben, Chris, Mitch. Wei or Nicole (don't ask Bernard!).

