UNIX is a type of operating system traditionally used by academics. Indeed, up until recently, working in molecular simulation required knowledge of UNIX. Though this is not as true these days, many molecular dynamics packages, tools, and ancillary programs are UNIX-based.

We will be using some of these tools starting next week, so here we take some time to get familiar with some basics. For the most part, you can search using Google; I will try to provide some guidance and/or decent links here.

SHELLS

It is easy to find tutorials on shells. A somewhat generic one is
here. Personally, I prefer the tcsh shell. However, this is not the default on OS X. If you would like to see how to change your default shell on OS X, directions are here. Here are a few links that I have found to be pretty good:
OS X/linux/bash shell
tutorial
OS X/linux/tcsh shell
tutorial

The main issue you might have with your shell is that the current directory "." or "./" is not in your path. (one way to refer to a file in the current working directory is ./filename). This is supposedly a security risk, but everyone I know puts "." in their path. To add "." to your path:
  • bash: at prompt type "PATH=.:$PATH; export PATH" (or put this in your ~/.profile file)
  • tcsh: at prompt type "setenv PATH ".:$PATH" (or put this in your ~/.tcshrc file)

To set this permanently, check tutorial sections on modifying the startup file(s).


EDITORS

For basic editing, you may use Simple Text. More ambitious users may wish to try vi (or
vim) or emacs. You must be careful using Notepad and/or simple text, as we wish to keep the files ASCII/text files. Sometimes OS X would like to give these files different suffixes and/or change the file to some sort of formatted data, which is not good!

PLOTTING

Many of you have been using Excel to make graphs, however Excel is a poor choice for scientific plotting. My favorite program to use is
Grace. It is menu-driven, and after a short amount of time, you are able to make really nice data plots, as well as regression lines, in-place data manipulations and so on. Here is one tutorial. Next choice for new scientists would probably be Plot2, available at the App store or the website for free. Here is a short tutorial (under construction).

FINALLY, if all these options either do not work for you, or you are finding yourself spending a lot of time (by "a lot", I mean more than 30 minutes), trying to get a plotting program to install/work, just use Excel.) Remember that Excel looks only at file extensions to tell what is in the file, so you may have to use ".txt" or ".csv" instead of ".dat" for you data files.


FILE TRANSFER

Whether you want to send a pdb file TO the remote machine, or get one BACK from the remote machine, you will need to use 'scp'. scp stands for "secure copy". The general format of the command is
(sending)
$ scp local-file user@remote-machine:path
or (receiving)
$ scp user@remote-machine-IP:path/remote-file local-directory
It is generally easier to send from, and pull to your Mac. So, you may wish to have two terminals open: one which is connected to the remote machine, where you issue your commands and make new files, run jobs, etc. On the other, you can pull the files you have created back to your PC so you can plot data, load into VMD locally, etc.

Let's assume you have the file 1RSV.pdb in your home directory on a remote machine, and you wish to put it in your VMD directory on your PC. The command would be
$ scp user@remote-machine-IP:1RSV.pdb ./VMD
(Recall that "." means "current directory"; The colon after the machine IP represents your home directory in this case.) If you have the file trajectory.dat in your VMD/data/ directory on your PC, your current working directory was your home directory, and you want to put it in a directory called "Chem181" on the remote machine, the command would be
$ scp VMD/data/trajectory.dat user@remote-machine-IP:Chem181/

(For all of these commands, you will first get an authentication/fingerprint message—it is OK to acquiesce to this—then you will have to enter your remote password for each command.)

There are good GUI applications for OSX (
Transmit is the one I have used).

Back: Introduction to NAMD


Next: Assignment 3