Running Applications in UNIX

This document is intended to explain the basic commands and procedures for running statistical applications on a UNIX platform. Information is tailored to the UNIX environment present in SSD's Economics Laboratory, yet links are provided which reflect a more general and complete introduction to the UNIX operating system, as well as each particular software application.

Getting a UNIX Command Prompt

After you have logged on to a machine in the Econ Lab, there are two ways to bring up a UNIX command prompt:
  1. To run applications using Xwindows, simply double-click the Xterm shortcut on your desktop and enter your password.
    (Instructions for setting up this shortcut can be found here.)
  2. To run applications in plain text mode, click the start menu select 'SSH Secure Shell Client'. Press 'Enter' to connect and enter the host name (athens.uchicago.edu) and your user name. (The first time you connect through SSH you will receive a message about saving the host key, just click Yes). Then enter your password at the prompt and you will see the command prompt.

Running Applications From Home

To run applications on the Athens server from home, follow the same steps as in #2 above. (If you're on the UC network you can get a copy of SSH here. If not, check out www.ssh.com.)

To run applications from home in Xwindows mode, you also need a copy of XWin32.

Basic UNIX Commands

Here are some of the most common commands that you will need to get started running applications in a UNIX environment.

pwd
print working directory. This will tell you which folder you're currently in. Upon logging in, you will be in the root of your home directory (athens/yourloginname).
ls
list. This will tell you which files are in the current directory. Use ls -l to show file details.
cd
change directory. Use cd foldername to navigate to a subdirectory or cd .. to go up one level.
mkdir
make directory. Use this command to create a new folder inside the current one.
cp
copy. Use cp oldfile newfile to create a copy of oldfile in the current directory.
rm
remove. Use this command to delete files.
rmdir
remove directory. Use this command to delete folders.
mv
move. Use this command to put files in a different folder (mv file1 /temp/) or just rename them (mv file1 file2).
quota -v
Use this command to determine your current disk usage and limits.
&
The & symbol is paired with another command to run that command as a background process. For example, if you want to execute an SPSS program in the background you can type: spss& inputfile >outputfile
For more information on backgrounding specific applications please read our backgrounding documentation.
ps
This command lists the processes that you currently have running.
kill
Use this command to end a process you have running.
lpr
Use this command to print a document from UNIX, like this: lpr mydocname. (You can use the lpq command to check the print queue.)
emacs, vi, pico
These commands will open one of the three text editors available on UNIX.
chmod
You can use this command to edit file permissions.
man
manual. Use this to get help with the functions and syntax of other UNIX commands. For example: man cp.
For a more complete list of UNIX commands and features, check out these sites: And for a more comprehensive introduction to UNIX, look here: There are also a few differences in the way applications run on UNIX as opposed to Windows. Here are some application specific features to take note of:

SPSS

Type spss to start, and ctrl-Z to exit.

To run an SPSS prodram from the UNIX prompt, type:
spss -m inputfile >outputfile

The biggest difference in running SPSS in UNIX rather than windows is that output files are saved in a different format. Windows output files are saved as .out, while UNIX output files are .lst. These formats are incompatible, so to open a Windows output file on UNIX, or vice versa, you'll have to save it first as plain text. Data and syntax files are the same however, so as long as your analyses are saved as a syntax file, they can be run to produce output on either platform.

For more information on running SPSS in UNIX, check out these sites:

SAS

Type sas to start, and ctrl-D to exit.

To run a SAS program from the UNIX prompt, type sas filename. The SAS log file will be saved to filename.log and the output will be saved to filename.lst.

While running, all the data files created by the SAS program are stored under a temporary workspace (/tmp). After running the program, the temporary files are erased automatically, but if the running process is interrupted the temporary files will remain. If this occurs, go to /tmp to delete the working files and release the space back for public use. You may save the SAS working data file as a permanent data file if you want to use the data periodically. The simplest way to do this is to specify the storage space by assigning the library.

For more information on running SAS in UNIX, check out these sites:

Stata

Type stata to run in plain text mode, or xstata to run in XWindows mode. Type exit to exit.

To run a Stata program from the UNIX prompt, type:
stata -b do mydofile

Stata runs basically the same in Windows and UNIX. The only thing you'll need to get a feel for is the filesystem setup. Once you've started Stata, you can type pwd to find what directory you're in. This is your default working directory. To find where the Stata executable resides, where ado files are stored, etc., use the sysdir command.

For more information on running Stata in UNIX, check out these sites: