Introduction to Linux command line

The trainers today

  • Jelle Treep
  • Lukas van de Wiel
  • Dawa Ometto
  • Shiva Nadi

What is a shell

What is a shell

a computer program that provides relatively broad and direct access to the system on which it runs. The term shell refers to how it is a relatively thin layer around an operating system. A shell is generally a command-line interface (CLI) program [Wikipedia]

  • Type commands to do things
  • has a prompt:
jelle@localhost $ 
  • Run programs and scripts
  • Can be interactive or non-interactive

Alternatives

Why shell?

  • Vast Majority of HPC systems are:
    • Linux based
    • Operated via Shell
  • Lots of flexibility
  • Not so difficult to learn
  • Automation
  • Git

Bash vs. other shells

Bash is often the default shell on Linux systems.

  • Powershell (windows)
  • Z shell
  • many others

For now: Important to know that others do exist.

Today:

Nelle Nemo, a marine biologist, has just returned from a six-month survey of the North Pacific Gyre, where she has been sampling gelatinous marine life in the Great Pacific Garbage Patch.

  • 1520 samples
  • relative abundance of 300 proteins
  • needs to run these 1520 files through an imaginary program called goostats.sh
  • goostats.sh takes 30 seconds

Today:

We will explore the ways Nelle can achieve this in a better way. More specifically, we will learn how Nelle can automate the repetitive steps, so that her computer can work while she writes her paper.

As a bonus, once she has put a processing pipeline together, she will be able to use it again whenever she collects more data.

Today

  • navigate to a file/directory
  • create a file/directory
  • check the length of a file
  • chain commands together
  • retrieve a set of files
  • iterate over files
  • run a shell script containing her pipeline

Credits:

The contents of this workshop are for a large part based on material of the workshop ‘The Unix Shell’ developed by the Software Carpentries and published under CC BY 4.0 license.