1.2 UNIX

 

1.2.1 Using UNIX Workstations in general:

 

• UNIX is case sensitive, which means don’t confuse upper and lower cases. Almost everything uses lower case.

 

• You DO NOT TURN OFF OR RESET THESE MACHINES.

 

• To start using a UNIX system you must identify yourself by entering your login name and your password.. If using telnet you must know the machine name also.

 

• Use the ‘passwd’ command to change your password. If you use a simple password, it will be easy to find, and somebody will break into your account, and wipe out all of your work. A good rule of thumb is that if it could not be found in a dictionary or index of a book it will generally be safer.

 

• Don’t be afraid to try something new, you can only wipe out your files, all others are protected.

 

1.2.2 Directories, Files, Etc.

 

• All of the computers in the lab share disks. Your directory will be available at any computer.

 

• Note: the UNIX slash is ‘\’, not the ‘/’ used on PCs.

 

 

• You can use standard UNIX commands to look around, and manipulate your directory, and files,

cd Change directory

pwd Show present working directory

ls List a directory

ls -la List directories in full form

rm remove a file (WARNING DON’T DO THIS IF YOU ARE NOT SURE)

mkdir make a directory

rmdir remove a directory

mv moves a file/directory from the first name to the second

cp copy a file/directory from the first name to the second

more type out the contents of a file

man bring up a manual page for a command

man -k brings up information on a subject

vi a text editor (some commands given below)

‘dd’ - delete a line (edit mode)

‘x’ - delete a character (edit mode)

‘r’ - replace a character (edit mode)

‘R’ - replace a string (command mode -> edit mode)

‘a’ - append to a line (command mode -> edit mode)

‘i’ - insert a string (command mode -> edit mode)

‘:w’ - write to a file (command mode)

‘:q’ - quit from a file (command mode)

ESC - move from edit to command mode

cursor key - move the cursor

ps -ef Print a list of processes running on the computer

kill -9 Kill a process running on the computer (uses the PID # from ps -ef)

passwd Change your password (protect yourself)

du Check your personal disk usage

df . Check total disk space available

quota -v Check how much quota you have left. Being over quota for a few days will result in your account being cut off automatically.

date get system date and time

who show who is logged into your machine

textedit A mouse based editor

pine A simple interface for mail usage

mail A somewhat bothersome mail tool (see pine).

 

• You can use wildcards when filenames. The characters used are,

* Any string

? Any Character

.. The directory above

. this directory

~ your home directory

 

• Some examples of valid wildcard strings are,

Ad* Advertise Advent.not Ad

Ad? Ad. Ade

Ad?.? Ade.d

??e.* ape.exe eee.thisisanother

../hi.* hi.there (in directory above)

~/*.there hi.there (in your home directory)

 

• There are no real limits to file name lengths, but users should be careful with nonalphabetic characters.

 

• Files that begin with ‘.’ are often system files (like ‘.login’), and should not be deleted, moved, or created unless you are sure that is what you want to do.

 

1.2.3 Advanced Concepts

 

• Besides the normal keyboard operation, some keys have special meanings. Erasing a character can be done with delete/rubout or backspace /control-h (^h), the actual key varies from machine to machine. Control-s (^s) and control-q (^q) are for flow control, typing a ^s will stop output to the screen, which can then be continued by typing ^q. ^d represents end-of-file, and is used to exit from several programs like mail, or possibly to log off the computer.

 

• Most workstations run the UNIX operating system, which comes in two varieties: 4.3BSD (Sun) and System V (SGI), whose differences are minor for the average user (except for printing). When one logs into a UNIX system, you are actually running a program (shell) this is in some ways similar to DOS. In the standard shell you are given a prompt, where you type your command. If it is not a built-in command, it searches on the disk according to a user-specified search path, for an executable program of that name. Almost all commands are programs that are run in this manner. There are also executable shell scripts, similar to command files on DOS. UNIX is limited to running a program of a size equal to the sum of its memory, and swap space. As the system is multi-tasking, any program (or part thereof) that is not currently being run when extra memory is required, is swapped (moved) out to the disk, until it is ready to run again.