teaching goals


  • what is high performance computing
  • rudiments of command line interaction
  • how to run a command in parallel across cores

eventually you will outgrow your laptop

linux = do whatever you want on high-performance compute systems

the command line is the computational lab bench

the command line is the “native” environment
for interacting with linux


similar environments also appear
on Mac OS and Windows

buy eggs

buy eggs


buy two dozen eggs

buy --dozens 2 eggs


buy, using cash, two dozen eggs

buy --using cash --dozens 2 eggs

buy eggs and fry them

buy eggs | fryingpan --oiled --minutes 4


buy eggs, fry them, and store on plate

buy eggs | fryingpan --oiled --minutes 4 > plate

You can write a little program
to execute command line calls.

This is called a “shell script”.


buy eggs | hands --action crack > bowl
whisk --input bowl | fryingpan --oiled --minutes 4 > plate

but first, let’s mash the keyboard

buy eggs | hands --action crack > bowl
whisk --input bowl | fryingpan --oiled --minutes 4 > plate


samtools view wgs_bam_NA12878_20k_b37_NA12878.bam \
               | cut -f3 | sort | uniq -c > contig_counts.txt
sort -n -r contig_counts.txt > contig_counts_sorted.txt
head contig_counts_sorted.txt

When to use shell programming?


Just you are only running other commands, like making a simple computational pipeline

For other tasks, use Python or R.

Unix philosophy

  • Write programs that do one thing and do it well.
  • Write programs to work together.
  • Write programs to handle text streams, because that is a universal interface.

May you be a happy and free ferret