Skip to Content

College of Arts & Sciences
Department of Statistics


Using UNIX

NOTE: To request a UNIX account, you must email help@stat.sc.edu and ask for one. The help staff will provide you with a UNIX username and password.

Our UNIX system runs on the various Sun computers around the department. It hosts the web-server and mail-server, along with fortran and c compilers, S-Plus, and your personal home page. The "public access" unix machines are in rooms 127 and 310 (your key will open the door to room 127). You can also use secure shell (SSH) to connect to them remotely from the PCs in the building. Any programs that take a while to run must be in "nice" mode, or they may be killed (ended).

There are several other sun machines in the building. Your computer privileges will be revoked for running programs on fhat, milo, statman, or urn. It is also inadvisable to run programs on someone's "personal" sun without permission.

Be sure to log-off the machine before leaving. If you are using SSH, you can exit the window by simply typing exit, and then by choosing Exit under the File menu. If you are on a Sun, then go to a blank part of the screen (outside a current window) and use the right mouse button to select Exit.

It is important to remember that UNIX is case sensitive (it matters if you capitalize or not.)

The Math department has a bare-bones Unix page. A simple manual can be found at a UNIX manuals web site.

Basic commands in UNIX

pwd tells you which directory you are currently in
cd puts you back in your home directory
cd .. moves you one directory lower
cd dirname moves you to the directory dirname (usually not called "dirname"!)
ls list the files in the current directory
ls -l list the files, their sizes, and the permissions.
ls -l | more lets you scroll through the list if it is to long to fit on the screen at once (type q to exit)
mkdir dirname makes a directory called dirname
cp f1 f2 copies file 1 to file 2
mv f1 f2 moves file 1 on top of file 2 BE CAREFUL!
rm f1 removes file 1 BE CAREFUL!
top shows you what other processes are running on that machine (type q to exit)
nice -10 pname runs the program called pname in nice mode
man commandname opens the help file for commandname

To copy text in unix, simply highlight it with the left mouse button. To paste, simply click the center mouse button (both buttons at the same time from a PC).

Printing The printers are for University work and they should not serve as photo-copiers!!! Over printing of duplicate copies or overprinting of personal documents will result in your printer privileges being revoked.

To print most kinds of documents, you can use the command lp -dprintername filename. So, to print on the printer hp6, the command would be lp -dhp6 filename. Do NOT use this command to print dvi files! For that, use the command dvips file1.dvi file2.ps to convert it to a ps file first.

Six of the printers are:

 

lex69 Room 219, this is one of your primary printer and you have a key to this room.
lex54 Room 127, this is another of your primary printers and you have a keey to this room.
lex4 Room 124 (locked after hours)
lex3 Room 303A (locked after hours)
lex70 Room 209 hallway

lpstat will show you your print jobs in progress. To cancel one of them, type cancel printjob#. For example you might have to type cancel lex4-621 for job 621 on lex4. The lpstat command will give you the name.

To set your default printer, type setenv PRINTER printername (for example setenv PRINTER hp127).

Editing files with emacs: emacs is one of the principle ways to edit a text file (like the ones for your personal web-pages) on Unix. Other possibilities include vi and joe. To open a file using emacs, simply type emacs filename where the filename is the name of your file.

Basic help for this program can be found on the web at the reference card provided by the GNU site.

Changing your password in UNIX: The machine libano controls the passwords, and you must be on that machine when changing your password. If you are not logged into that machine, then your password might not change everywhere. As it is, it can take up to an hour for your password to successfully propogate to all of the machines. To change your password, follow the following steps:

  1. Log into your UNIX account on any of the machines
  2. Type rlogin libano and hit return
  3. Type passwd and hit return
  4. Answer the questions, beginning by typing in your current password
  5. Type exit and hit return