Introduction

Welcome to our introduction to using the Bash shell. This session is composed of two three-hour sessions

  • June 10 from 9:00-12:00 and 13:30-16:30 (Eastern Daylight Time)

and each session is a series of short live demos and exercises.

Each part builds on the previous parts, so it is best to attend the entire thing from start to end and to do the complete the exercises. While we are starting assuming no prior knowledge of the command line, we will go quite far, so do not be off put if things seem pretty basic at the start.

Our training website https://training.computeontario.ca has links to a readable version of today’s presentation in web, pdf, and epub format. You do not have to worry about taking notes or falling behind.

BigBlueButton and Etiquette

Before getting started, we would like to introduce you to the online platform BigBlueButton and discuss the online etiquette that we expect throughout the workshop.

First I would like to ask everyone to mute their microphone. You can do this by click the microphone icon. The microphone icon is in the far left of the menu bar on the bottom of the BigBlueButton window. You know your microphone is muted when you see a slash through the microphone icon.

BigBlueButton Menu

It is good etiquette to leave your microphone off unless you are speaking as otherwise everyone will hear the background noise from your space, and we will be forced to mute you, which is something you cannot undo. If you want, you can also turn off your video by clicking the video camera icon to the immediate right of the microphone icon. A slash through indicates it is off too.

There is a public chat messaging system in the upper left. Feel free to use this to ask any questions you may have during the presentation. Our staff members are monitoring this and will respond. Also note that there is a maximize button in the upper right of the main window that will expand the content to fit the main window.

On the subject of etiquette, we want to maximize learning in these sessions by creating a welcoming and supportive environment for everyone regardless of background, identity, or knowledge level. Please be mindful to not engage in any behavior that is going to diminish the experience for any of the participants or the instructors.

Motivation

We are going to teach you the old school way of running your programs and processing your data with your keyboard and commands and not your mouse and menus. In the process, we hope that you will discover that the keyboard and commands, far from being archaic, are actually very well suited for automation and keep track of what you have done to repeat it or communicate it to others in the future.

As a small example, say we had collected 100 .data files in the Example folder and wanted to prefix them with today’s date. This would be a long tedious point and click session using a GUI

GUI Rename Pain

Using the command line though, it would only be four simple lines and complete in less than a second

today=$(date +%Y-%M-%d)
for file in *.data; do
  mv $file $today-$file
done

It would also be trivial to save these lines in a file for future reference, share with a colleague, or incorporate them into a bigger set of commands to do more complex operations on the files. This last point is key. The command line composes. You can combine small bits into big bits, and big bits into bigger bits. This is extremely powerful. GUIs do not compose.