MS&E 130/231

Information Systems

Using the Stanford Computer Cluster






Introduction: Connecting to a Unix machine


The primary Unix computing cluster is on the second floor of Sweet Hall. A description of the machines, their names and capabilities is available here. One can either log-in directly to the computer by going to Sweet Hall, or remotely via ssh. If you use Microsoft Windows, then you might find it convenient to use PuTTY. When you connect, you will be asked for a user name, which would be your SUId, and password, which is the password you use to access email or Axess.

Common commands

Listing directories

By default, you have 200MB of disc space. To see the files in your home directory use the ls command:


[sanat@elaine4 sanat]$ ls
Desktop  News  Xrootenv.0  cam-tex-page  emacs-lisp  gloves  ladycrumpet  list      misc   nsmail  src  toprint
Mail     WWW   bin         cheeg         fonts       ips     limoges      log-anal  music  pens    tmp


Help files

If you need to determine what options a command takes, or its full description, lookup the manual using the man command. So for example, typing man ls at the command prompt will show you the manual page for ls.
List of common Unix Commands

Changing directories

The cd command changes directories. Issuing


[sanat@elaine4 sanat]$ cd misc
[sanat@elaine4 misc]$ ls
Images  cs197  doc  jjb  opre  tex
[sanat@elaine4 misc]$


Creating text files

To edit text files, such as programmes, use any of the number of editors available. Common ones are Emacs, vi, and pico.
Popular text editors

Further information

If you do end up spending a lot of time on Unix systems, then you might wish to review: Getting Started in Unix, or better still, take a look at: The Unix Programming Environment,  by Brian W Kernighan and Robert Pike. An online book on the Unix environment is here.

Compiling programs

Suppose you wish to compile the program hello.c
A C or C++ file may be compiled using the gcc compiler. The simplest way of doing this is to issue the command:
g++ hello.c
this will create a file called a.out, whcih is the executable. Typing:
./a.out
will run the programme.
The command:
g++ -o hello hello.c
will make hello the executable, which can then be run by typing
./hello

Instructions for programming assignments

  • The program should text-mode, ie should not create any windows, and should run in a command window.
  • When submitting, please send both the source code and the executable via email.