This lesson is my customized version of the Software Carpentry lesson on The Unix Shell. Please see the original lesson for a more detailed walkthrough

Please download the data folder if you want to follow along

What is ‘the shell’?

For our purposes the shell is ‘that box where you type in commands’. It is a command-line interface that looks like DOS (if you’re old enough to remember DOS). It has many names and ‘flavours’; Windows users have the Command Prompt, Mac and Unix/Linux users will have the terminal. In this workshop we will learn the BASH shell because it is the most popular shell language as well as being the default for Unix/Linux/Mac’s (and can be easily installed on Windows machines).

Why would scientists want to us it?

Computer scientists will sometimes give the argument that ‘everyone’ should learn to use the shell because that ‘came first’. That argument does not fly with me! I am not a computer scientist and if it does not help me with my own research, I do not care!

We are here learning about the shell, so it must be helpful and here’s why:

  • Modern operating systems with graphical user interfaces are design for ‘typical use’. Scientists are not typical users and in the process of discovery, by definition should be doing something no one has done before. If something has never been done, it’s hard to believe an operating system has been designed to do it!
  • In this process of discovery, you will mess something up your computer. The command line is often the place to fix those issues
  • You can write it all down in a text editor and save it. Writing down the commands in a script means it is reproducible!