The Bash Shell

The Bash shell has been around longer than many 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 that they don’t have to type 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, like IRIDIS at the University of Southampton). 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 download some files to follow this lesson. First, you need to open a terminal:

  • On Windows: run “Git Bash”, which you installed as part of the software prerequisites
  • On Mac OS X: accessed by opening the “Terminal” application, which can be found in the “Utilities” folder which is in your “Applications” folder
  • On Linux: this will depend on the Linux distribution you are running, but you should be able to find a “Terminal” application in your desktop’s application menu

Once you’ve done this, a window should appear. Type the following into the prompt that appears (pressing enter/return after each line):

$ cd
$ git clone https://github.com/Southampton-RSG/2020-10-29-socobio-crs

Topics

  1. Introducing the Shell
  2. Files and Directories
  3. Creating Things
  4. Pipes and Filters
  5. Shell Scripts
  6. Loops
  7. Finding Things
  8. Additional Exercises

The answers to the exercises can be found here.

Other Resources and Further Learning