next_inactive up previous


Introduction to unix/linux

Rafael A. Irizarry

Our unix/linux systems

Our machines

The department has various types of computers:

These are all conceter via the school's network.

We are about to upgrade to a new computing system. In general things wont change much (expet we will have much more powerful computers). Our current set-up is the following:

THe new computing system will also have a separate machine for running SAS jobs.

Access policy

It is okay to login to and run jobs on athena as long as you are careful when running CPU and memory intensive jobs. This includes in particular, R and Splus background jobs. You can run as many jobs as you want as long as you nice them at 19 (this means they get the lowest low priority. We will get to this later). At nice 10 (medium priority) try to run only one job at a time. When there are 7 or more medium priority jobs already on athena then it is especially important that you run at most on job. Any job taking more than 15 minutes needs to be a medium or low priority.

Similar rules apply to biopile although we are still figuring this out. For an account on biopile contact Jerry Gilyeat (ggilyeat@jhsph.edu).

The webserver should not be used to run CPU intensive jobs and you should not need to login to it.

To obtain access to the faculty workstations contact them directly.

Note: When the new computer system comes along we will encourage you to run computationally heavy jobs only on the cluster or computing server.

Getting Started

You should already have an account on athena. If you don't contact Jiong Yang (jyang@jhsph.edu). The most convenient way to use athena is using the sunrays. To login jiggle the mouse and a ``login'' window should appear. Enter your login and password. Notice UNIX is case sensitive.

X windows, desktop environment, and window managers

By default unix/linux doesn't have a windows system. These are the graphics, buttons, icons, etc... you typically see on a computer. However, in practice all unix systems run X windows and some window manager. Athena runs X and a really terrible desktop/window manager called CDE. Gnome and KDE are much better alternative and come in the standard linux isntallation. A really old window manager (fvwm) comes with cygwin.

Unix desktops are useful but most of the powerful tools are run from the command line and don't rely on X.

So the first thing you want to do when you start using a system with desktop environment is open a terminal emulator. This will give you a command line.

When you use ssh you will automatically be on a terminal emulator.

File Server

Directories

Permissions

Executables

All programs that run on unix are executable files. Many are binary so you can see them. For example try looking at ls less /bin/ls. However other executables you can see, less /users/faculty/ririzarr/solaris-bin/mydvipdf.

You can easily make a program and run it. For example use this simple script to install a local version of R:

After downloading the source create a file called installR-1.9.1 with the following content:

tar -xvzf R-1.9.1.tgz
cd R-1.9.1
./configure --prefix=/users/faculty/ririzarr/R-1.9.1
make
make install

I run this by typing ./installR-1.9.1 in my \~ririzarr/src directory. Here is an example of a command that will run R in batch mode:

/usr/bin/nice 19 R --no-save BATCH $1.R -o a.out &

You can also use

/usr/bin/nice -n 19 R --no-save < $1.R \&> a.out &

Important: The & at the end runs this job on the background. It is useful to learn the commands: fg, bg, kill, top to manipulate what is running in the background and foreground. It is also important to learn about standard output and standard error. The & and > in front of a.out says ``send error messages and output to the file a.out''. & is std error and > is for output. The default is to screen.

Important: The nice in front of a command says to unix to let other jobs have priority over this one. This is important because the people using the system interactively should not be affected by a job that you are willing to wait hours for. In tsch you type

nice +19
. You can also renice using top

The shell

The shell is a program that runs on pretty much all unix/linux machines by default. It is hard to distinguish between what is unix and what is the shell, and you don't necessarily need to know the difference. All shells are similar and the important stuff is in all of them. But, you need to be aware that there are different shells.

My favorite is bash. Currently, this is not the default on athena. So if you want bash you need to ask Jiong to change it.

Wild cards

All shells use the same wild cards.

For example, [a-z]* matches all names in the current directory beginning with one of the letters a through z.

the rc file

You can define your own commands and change options for you shell using the .bashrc file.

To define ``new commands'' use the aliases. See ~kbroman/.bashrc for an example.

Creating your own bin

If you type ls on your prompt, the shell knows it's a command so it needs to find the file to run it. There are many predefined places but the pwd is not one them. If you want to run an executable on your pwd you need to type ./filename.

However you can change the places to look by changing your PATH environment. We recommend having a directory called bin in you home dir where you store executables you create (for example your own copy of R). To change the path in tcsh you can use:

setenv PATH
/users/faculty/ririzarr/bin:/usr/dt/bin:/usr/local/bin:/bin
:/usr/bin:/usr/sbin:/sbin:/usr/ccs/bin:/usr/openwin/bin:/usr/local/teTeX/bin/sp
arc-sun-solaris2.8:/usr/local/office52/program:/usr/local/vni/bin:/usr/local/xg
obi/src:/usr/local/SUNWspro/bin:/usr/ucb:/opt/SUNWdtpcv/bin:/export/home/mtaylo
r/postgresql/bin

PATH=/users/faculty/ririzarr/bin:/usr/dt/bin:/usr/local/bin:/bin
:/usr/bin:/usr/sbin:/sbin:/usr/ccs/bin:/usr/openwin/bin:/usr/local/teTeX/bin/sp
arc-sun-solaris2.8:/usr/local/office52/program:/usr/local/vni/bin:/usr/local/xg
obi/src:/usr/local/SUNWspro/bin:/usr/ucb:/opt/SUNWdtpcv/bin:/export/home/mtaylo
r/postgresql/bin

Once you do this your unix will look for programs in your bin directory.

Useful commands

For others see: http://www.biostat.jhsph.edu/~kbroman/unix_tools/

Remote login

You can login to athena (and from athena to other machines) from outside Hopkins using ssh.

MacOS X and Linux come with ssh and X windows so you can open X windows from home without any effort. With a fast connection it will seem as if you were at work.

For Microsoft windows you need to download and install ssh (there are two openSSH and commerical ssh, both free). If you want X capabilites you need another program. cygwin comes with a free version of X for msft windows. There are other products that are nicer but cost money.

Web pages

Notice you all have the ability of creating having a web page under http://www.biostat.jhsph.edu/~loginname. All you need to do is create an index.html file in the directory public_html

About this document ...

Introduction to unix/linux

This document was generated using the LaTeX2HTML translator Version 2002 (1.62)

Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999, Ross Moore, Mathematics Department, Macquarie University, Sydney.

The command line arguments were:
latex2html -split 0 unix.tex

The translation was initiated by Rafael A. Irizarry on 2004-09-02


next_inactive up previous
Rafael A. Irizarry 2004-09-02