The Unix Shell

The Unix shell has been around longer than most of its users have been alive. It has survived so long because it’s a power tool that allows people to do complex things with just a few keystrokes. More importantly, it helps them combine existing programs in new ways and automate repetitive tasks so they aren’t typing the same things over and over again. Use of the shell is fundamental to using a wide range of other powerful tools and computing resources (including “high-performance computing” supercomputers). These lessons will start you on a path towards using these resources effectively.

Prerequisites

This lesson guides you through the basics of file systems and the shell. If you have stored files on a computer at all and recognize the word “file” and either “directory” or “folder” (two common words for the same thing), you’re ready for this lesson.

If you’re already comfortable manipulating files and directories, searching for files with grep and find, and writing simple loops and scripts, you probably won’t learn much from this lesson.

Getting ready

You need to have a Unix terminal installed on your computer. For instructions on how to install this software, visit the CSDMS workshop page.

You also need to download some files to follow this lesson:

  1. Download shell-novice-data.zip and move the file to your Desktop.
  2. Unzip/extract the file (ask your instructor if you need help with this step). You should end up with a new folder called data-shell on your Desktop.
  3. Download pbs-examples.zip and move the file to your Desktop.
  4. Unzip/extract the file. You should end up with a new folder called code-shell on your Desktop.
  5. Open a terminal and type:
$ cd

In the lesson, you will find out how to access the data in these folders.

Topics

  1. Introducing the Shell
  2. Files and Directories
  3. Creating Things
  4. Pipes and Filters
  5. Loops
  6. Shell Scripts
  7. Finding Things
  8. Cluster Computing and PBS Commands

Other Resources