Prof C. Cameron **** UNIX TIPS **** Revised 10/8/03 In case you need to use Unix: e.g. Because it is not avaialble on PC e.g. Because you want to connect from home and can't connect to a PC lab THIS INFORMATION WAS CURRENT AS OF 10/28/1993. I HAVE NOT RECHECKED IT. INFORMATION SOURCES The following information was obtained using the UNIX commands help news Additional information can be obtained using the UNIX commands man -k keyword lists commands relevant to keyword man command prints out the manual for a command or by reading one of the tutorial papers (available from I don't know where) e.g. UNIX for Beginners or An Introduction to the C Shell, to get started. or if you get desperate by calling IT-CAP at 2-2548. There are also some free handouts at IT-CAP in Surge II. Note that Unix is case sensitive! Things to do include: 1. Review files 2. Edit Files (command pico) 3. Print files (command lpr -h) 4. Download files from UNIX to PC or MAC 5. Invoke a UNIX Shell 1. REVIEW FILES Useful UNIX commands are: ls to see the names of files and directories you have cd to change directories (e.g. cd mydir changes to directory mydir) more to print file on screen (e.g. more myfile to see myfile) 2. EDIT FILES There are many possible UNIX editors to use. The easiest to use is pico. Give the UNIX command Pico Then use the on-line help (^G where ^ is obtained by shift 6). Other UNIX editors include vi and ex. Alternatively, you can download a file to the PC or MAC and use a PC or MAC editor. Downloading is discussed below. 3. PRINT FILES Print files using UNIX command lpr -h You need to additionally give the name of the printer and the file. Printer names will change over time. The UNIX command news gives a lot of information, including the current printers. This is given below. For example, to print file myfile in Hutchison 76 [will not work any more] lpr -h -P76hutcha myfile The -h option saves a page by not giving a header page. If you get a large file by ftp, gopher, mail, etc. and only need part of it, then first edit it using pico (eliminate unwanted lines by the ^k command) or some other editor to extract what you want. 4. DOWNLOAD FILES FROM UNIX TO PC OR MAC Use an ftp program such as WSFTP 5. INVOKE A UNIX SHELL Different UNIX environments exist with different ways to invoke UNIX commands. The UNIX C Shell environment is preferred. New accounts are sent to this. Old accounts you may want to change to the C shell environment as discussed below. To get information on the C shell commands give the UNIX command man csh This gives very lengthy output. END