University of Washington
Basic design and commands for using local and remote unix boxes on the University of Washington Uniform Access Accounts.
Unix is vast: it has hundreds of commands (most of which you do not need to
know), many nifty ways to customize its operation (which space does not allow
us to more than hint at), and a great deal of online documentation (which you
can read and grasp after you understand the program you're reading about).
Unix is the ultimate programmer's operating system and, as they say, real
programmers don't write documentation (just comments in the programs
themselves)
. Fortunately, there are now available a number of excellent
reference books and guides to Unix
. Most
fortunately of all, if you know another command line operating system (say,
MSDOS), you can get up and running in Unix with only a handful of commands and
navigational advice. Section One gives the layout and commands for the
computer where you have your user account; Section Two takes up accessing
and manouvering on a remote computer in a network.2
Today's Unices are very similar to MSDOS at the basic level, which is not surprising, considering that DOS borrowed a great deal from the Unix of the time (mid to late 1970s). Some differences really are small: the mark for "subdirectory of" in Unix is "/" (front slash); in MSDOS it slants the other way. One major difference hits you early and hard: in MSDOS, it doesn't matter whether you use upper or lower case letters or a mixture of them. So
copy \pix\picture.gif \gfx
is the same as
COPY \PIX\PICTURE.GIF \GFX
or
Copy \Mnt\Picture.gif |Gfx
but these are all different instructions in Unix--only the first would work, actually, since commands must be all lower case. Unix has virtually no canonical format for file names, so
picture.gif.blurry
or
nightmare.story
are legal file names, as is
nightmare_1st_draft
Just about any thing you can type from the keyboard is a valid file name:
Anyone can read and copy or get (``download'') any of the files listed here. This subdirectory is /simtel/msdos/teaching and as you might guess from the file titles, contains various utility programs (grade books, quizzes, puzzles, seating charts) that teachers might find useful. (We have used one of the grade books found on this subdirectory.) The files are open to everyone to read or take (they are called "world-readable"), but they cannot be freely modified--"written" to the directory--hence the rows of "r's" (for read) with no "w's" with them in the right-hand columns; the superuser, however, has to be able to add and remove them to maintain the archive, so they have "w" permission along with "r" in the left column. None of these have "x's" in any column, since they are not executable files in their present form or purpose. This display was generated in response to the rather "verbose" command dir, which is really just an alias for the command ls -l (="list, long"). If you just gave the ls command, you would get a more succinct list of files without the permissions, dates of posting, person posting, and size. There will be more about reading and plundering other people's open directories in the section on ftp.
As noted earlier, Unix has hundreds of commands; it has hundreds of uses, too. The ones you need first to work on the Net are those for navigating, handling files, and exiting. These are the commands that drive you crazy until you get them in your fingers. We split these into navigating commands, file manipulation commands1.2.2 and exiting1.2.3 .
find /simtel/msdos -name gradebok.zipand hope it would come back with something like
/simtel/msdos/teaching/gradebok.zip
tar xvf filename.tarwhich will build the tree structure at the spot where the tar file is located. A file ending in .gz, .Z, or .tgz is compressed and can be unzipped using gzip, the GNU utility. The effect of unzipping and untarring is like that of pkunzipor unzip with the -d toggle; extensions such as .zip are almost certainly MSDOS files but can be unzipped under Unix withunzip which exists on Unix computers.
dir /simtel/msdos/teaching |lessSometimes this piping to less ormore will work for dir but not for ls -al. Try another one if the first you think of doesn't work.
mv gradebok.zip grdbook.zip
prt -queue xerox myfile.psWill send your file "myfile.ps" to the ACC for printing. Most printers will handle any old text file, a postscript file (myfile.ps) or a compiled TeX .dvi file. Something similar works within labs for local printers. For example, in the Odegaard Colab
prt -q ougl_uwired_hp myfile.pswill do the trick.
Getting off line is not as easy sometimes as it seems it should be. You can escape from most processes and programs with the abort (Ctrl+c) and suspend (Ctrl+z) commands; similarly you can more properly exit them or quit them with (these are hard!) exit and quit or just q. But when you try to logout from your account (with logout, b'gorry), you may get a message ``There are processes active.'' This is an error message, folks, and the machine will not log you out. What you need to do is to kill the process or processes that you left in suspension sometime during the session. But how to know what these are, and how to kill them? The command ps (``process status'') will return a list of the processes currently active by name and with a process id number; you then can issue a kill command followed by the process number
In this end of a session, the first attempt to logout was thwarted by stopped processes, which ps determined to be two---the trn news reader and an attempt to read the directory at the sunsite ftp archive in North Carolina. These were killed, and then the logout attempt was successful.
That is a core of commands and moves given by every shell around for Unix. Now we turn to a core of useful programs that also are found at virtually every site.
Just about anywhere you find Unix, you find these programs.
Unix has a lot of on-line documentation that can remind you of the syntax of commands and give a clue as to why something is not working.
man prtand after a short while a screen of information on prt will come up giving the syntax of the command and a list of all the optional toggles and flags. Usually it goes to one of your pagers, either less or more, so you can scroll around in it. If you ever get to use Unix in a graphics mode, look for the program tkman. The bad news about man is that it goes nowhere if you don't have a MANPATH set for it to search. Even if you find a man file that you want to read in one of the normal places and try to use a text-file reader (like less) to read it, it will come up pestered with typesetting mark-up tags.
info --directory /public/lib/info(or wherever) and it will read the ``top'' of tree of info files found there. If you forget (and you will forget), just remember info --help.
There are a number of different schemes or protocols which can be used to network computers together. Some, which we associate with Local Area Networks, mount some or all of the directories of one computer into the file system of another so it appears as a drive or subdirectory of the other one. (For Unix, this type of networking is done via a program known as the Network File System--NFS.) With this sort of mounting, the remote computer acts very much as though it were simply a part of your local one. Some of the Uniform Access computers are linked together so as to exhibit file structures branching from a single root. Mead and Saul, for example, share a common root with Weber and the anonymous ftp site. Others of the Uniform Access galaxy are not so connected and can only be reached from Saul etc. by remote login/telnet/ftp as if they were thousands of miles away.
The underlying mechanism for this sort of remote transfer is TCP/IP (Transportation Control Protocol/Internet Protocol, if you want to know). By means of telnet we can read directories and sometimes perform other limited operations on computers that we do not have user privileges on. (If we do have user privileges, then we can commence to move files around, rename or delete them and in general make ourselves right at home).
Every computer that communicates via TCP/IP has an IP address, which is a set of four three-place digit fields, the familiar 125.102.54.110 sort of thing. Since human memory works better with words than digits, most of these addresses are paired with spelled names such as goolagong.cs.oz. When you ftp or telnet to such an address, the message passes first through a computer that replaces the verbal address with the numerical one--a DNS, or Domain Nameserver, it is called. (If the DNServer is down, or incorrectly set up, you can send the numerical address if you know what it is).
TP stands for File Transfer Protocol, and is the basic means of up and down loading files to and from remote computers. There are a number of improved versions of ftp such as ncftp, wuftp, and fetch (for Macintosh). Mostly commonly we think of ftp as anonymous ftp--scanning directories and downloading files from remote computers which have been deliberately made available to anyone regardless of their name or address. When you ftp into a machine with anonymous ftp, you can just type "ftp" for your login name and password (or in a very few cases give your address as your password, as the site may instruct you).
You can also ftp using your user name and password to a machine on which you have an account. To up or down load from your account on a UA computer to another one via ftp, you can establish a link giving your login name and password. Then you can ls and cd to the subdirectory you want and get the files you want (if you are using an older ftp it would be a good idea to give a "bin" command first to tell it to send the file as a binary, not an ascii file). To upload to the account from the current directory of your local machine, use put plus the file name. To down load multiple files from the subdirectory, use mget and to upload, mput. Finally, to change your local directory so that arriving files will go where you want them to, or so that you can find the files you want to send, use lcd ("local change directory").
If your web browser supports ftp (as Netscape does, for example) you can go that route, but only for anonymous ftp. If you run into one of those sites which wants something besides "ftp, ftp" to log in, you are out of luck.
You cannot ftp to or from your account over a simple telephone connection, for in that case you have no local IP address. If you have a Slip, PPP, or other tricky connection (slirp, term, twinsock) you will have, or can fool the computer into treating you as if you have, an IP address.
That, for the time being, is enough bones.