Skip to the content.

Learning Objectives

What even is shell?

You have likely heard the words bash, shell, unix, and linux before but may not know what they mean or how they relate. Before we even access the shell let’s try to understand these terms.

Foxtrot by Bill Amend

Starting with the shell

Depending on your operating system, there are different ways to access the shell:

With Macs

Macs have a utility application called “Terminal” for performing tasks on the command line (shell). We can open this utility to access the shell. This is generally found in /Applications/Utilities/Terminal

With Windows

By default, there is no terminal for the bash shell available in the Windows OS, so you have to use a downloaded program. We recommend “Git BASH” a shell (bash) emulator that is a part of the Git for Windows download.

Command prompt

Once you have opened the shell, you should see the command prompt ending with $. It will have some characters before the $, something like [MacBook-Pro-5:~], this is telling you what the name of the computer you are working on is.

[MacBook-Pro-5:~]$ 

Downloading data

We will be exploring the capabilities of the shell by working with some RNA-Seq data. We need to download the data to our current folder using the link below. To do so, follow the step-by-step instructions below.

1. Find out what folder we are currently inside. To do this, we can use the ‘print working directory’ command:

$ pwd

On a Mac your current folder should be something starting with /Users/, like /Users/marypiper/.

On a Windows machine your current folder should be something starting with C:/Users/marypiper. To find this in your File explorer try clicking on PC and navigating to that path.

Once you have identified which folder you are in, this is where we will be downloading your data.

2. Right click on the link below, and be sure to “Save link as…“. You will be prompted to choose a folder within a Finder/File Explorer window. Navigate to the directory that was listed when running pwd.

3. Once you have downloaded the file to the correct location, go back to your terminal window and type the ‘list’ command:

$ ls

ls stands for ‘list’ and it lists the contents of a directory.

You should see unix_lesson.zip as part of the output to the screen.

4. Finally, to decompress the folder, we can use the unzip command:

$ unzip unix_lesson.zip 

You should see output stating the contents of the folder are being decompressed or inflated; this is good.

5. Now when you run the ls command again you should see a folder called unix_lesson.

$ ls

This lesson has been developed by members of the teaching team at the Harvard Chan Bioinformatics Core (HBC). These are open access materials distributed under the terms of the Creative Commons Attribution license (CC BY 4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.