Unix / Linux

The Unix operating system was developed at Bell Labs in the early 1970s, a decade before the graphical user interface (mouse / cursor / windows on screen) was commercially introduced. Unix is text-based; commands are typed.  Yet Unix dominates all but the personal computing market, because it is efficient in the hands of an experienced user, and designed to be automated.  For research computing, familiarity with Unix is essential.

Starting with Unix

An excellent on-line tutorial for starting with Unix is here.  We have written a short introduction to Unix for new users, available here.  To test your familiarity with Unix, try these exercises.  The solutions are here.

Learning vi

The old-school Unix editor, designed with the same philosophy, is vi.  vi uses terse and powerful typed commands to navigate in a document, insert and modify text, and search and replace.  A well-designed tutorial for learning vi is here.    Once you have learned the basics of vi, this summary is a convenient reference.

Bash shell scripting

Shell scripts are short programs that can be used to automate interactions with the Unix operating system.  The shell scripting language is an extension of operating system commands, so shell scripts are particularly well suited to this purpose.

Although many guides and tutorials are available online, we have found few are well tailored for the typical applications of computational research — preparing input files, launching jobs, and extracting results from log files.

We have prepared this tutorial as a comprehensive introduction to bash shell scripting, bearing in mind the language features and techniques most relevant to our purposes.  The tutorial includes several annotated examples of shell scripts from our research, which illustrate the main applications and techniques.  A .zip file of the scripts and their input files can be downloaded here.