The UNIX operating system
An operating system is a program that provides all the services that make a workstation really useful: disk access, command execution, network access, etc. The Linux workstations that we use run a version of UNIX as their operating system. The word UNIX is derived from the name of an old operating system called MULTICS: MULTICS was a very large and complex system, whereas UNIX was designed to be small and simple.workstations
Each workstation is a computer with its own central processor (CPU), memory, display, and communications hardware. Each of these workstations runs a copy of the UNIX kernel, or program, so that each user has the undivided attention of the CPU. Most workstations share the disk space of one or more file servers, with each kernel managing that space locally. The file system structure is explained on another sheet; this structure should appear to be exactly the same no matter which workstation you login to.logging in to other workstations
When you need to login to a remote workstation, you can do it in either of two ways: type the name of the workstation in an xterm window, or open a new xterm window to it. In general, we would like for users to not remotely login (ssh) to other workstations, since that will tend to interfere with whoever is on that workstation locally.files and file names
The entities that appear in the file system are called files. There are two main types of files: regular files and directories; note that the use of the word file is assumed to include directories unless the word 'regular' precedes it. The difference is that directories can hold other files. Regular files can have one of several types, the two main ones being ASCII and data. Every file has associated with it an owner, a group, and a set of permissions. These permissions govern who has access to the file, and what kind of access is allowed. Permissions are divided into three sets: owner, group, and other, and consist of access for reading, writing, and execution (rwx). This is the first information that ll gives about a file. A file whose permissions are
-rwxrwxrwx
is readable, writable, and executable by anyone who can login to the system.
-rwx---
denotes a file that is readable, writeable, and executable only by its owner. Note that the common set of permissions for an ordinary text file is
-rw-rw-r-
and for a program (also called an executable or binary)
-rwxrwxr-x
You can recognize a directory by the leading 'd' in its permissions; most directories will look like
drwxrwxr-x
or
drwxrwsr-x
For directories, execute permission means that the user can cd to them. To change the permissions on a file, you can use the command chmod. Read the chmod man page for more details. In general, we would prefer that you not change the permissions on your files, because that may break certain programs, and make it more difficult for us to help you. An exception would be any private files like letters.printing
We currently have two printers available: one regular postscript printer, and one color postscript printer. The black and white printer (hp1) is in 1145 and the color printer (lexmark) is in 1169. The program that is used to spool print jobs (send them to the printer) is lpr. By default, all print jobs go to hp1; the color printer should be used sparingly.
To send a job to the color printer, use lpr -Plexmark filename.
Each printer also has a duplex queue for two-sided printing: use either lpr -Php1duplex filename. or lpr -PlexmarkDuplex filename for duplex printing.
As each job is spooled for printer, it joins a (possibly empty) queue of jobs on your workstation. This means that when you check on your job, you will only see those jobs that have been sent from your workstation, and not any jobs that may be spooled on other workstations. Each workstation competes for the attention of the printer, so it is quite possible for you to print something that doesn't come out for a while because jobs from other workstations get the printer first. To check on your queue, use the command lpq, which will display the contents of the default queue. Note that a consequence of having print jobs spool on the local workstation is that they take up some of that workstation's disk space: it is fairly common for a user to submit too many jobs and run out of disk space, especially with the color printer. Messages regarding the file system will appear in the console window, which should be checked if you suspect a problem. lpr is only useful for text files; when you are writing papers, you will most likely be using a text formatter called LATEX. You can print a LATEX file by processing it with the command latex; this produces a DVI file which can be printed with dvips. LATEX is a subject in its own right; the book The LATEX Companion is a good reference.file space
Now for a word about file space. To check on the available disk space, use the command df; it will show you the amount of space available on all the partitions that are mounted by your workstation. Most users will have a directory in a scratch partition; that is where any easily recreated files, files that don't need to be backed up or very large files should be kept. We'd like to keep increases in your home directory to less than 5 megabytes per week; much more than that is hard on the backups.
On occasion, we may run short of disk space in the main user partitions, in which case we will exhort the heavy users to clean up their acts.backups
That brings us to the subject of backups. We back up the file system to magnetic tape every morning about 2 AM. This means that any work in your home directory done before 2 AM of a given day will be safe after the backups have run. Note that no backups are taken during the day, so be especially careful about removing brand new files.rcs
It is often useful to be able to save intermediate versions of papers, programs, and abstracts as you work on them, just in case some changes are made that you later regret. Rather than trying to make copies of the file, and keep up with their names and times of creation, we use a utility called RCS. This stands for Revision Control System, and provides a mechanism for keeping old versions of files in a compact representation. The two main programs in RCS are ci (check-in) and co (check-out). When you want to enter a file into RCS, you check it in using ci; when you want to take it out for use, you check it out using co. In between, the file has a slightly different name, and is not writable. Note that the current version of RCS requires file locking by default; you must either check out your files with the '-l' option, or defeat strict locking using rcs -U filename . RCS maintains information about each check-in, such as the date and the reason for check-in (usually a brief note about the changes that have been made since the previous version). To enter the file foo into RCS, I would do
ci foo
ci will prompt me for a description of the file, and then rename it foo,v. To work with foo, I have to
co -l foo
and then I can edit it. At this point, there will be two files, foo and foo,v. You should never attempt to edit the RCS file (which ends in ,v) since it is the repository of all the saved information. In general, it is a good idea to leave a file checked in when it isn't in use, so that there isn't a plain copy out; this makes sure that all changes are saved in RCS. There are several options to the RCS system, including ways to assist you with files that need to be accessed by more than one person: read the man pages for rcs, ci, and co.