Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 27 additions & 40 deletions episodes/01-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exercises: 0

::::::::::::::::::::::::::::::::::::::::::::::::::

### Background
### What is the Shell?

Humans and computers commonly interact in many different ways, such as through a keyboard and mouse,
touch screen interfaces, or using speech recognition systems.
Expand All @@ -26,52 +26,39 @@ The most widely used way to interact with personal computers is called a
With a GUI, we give instructions by clicking a mouse and using menu-driven interactions.

While the visual aid of a GUI makes it intuitive to learn,
this way of delivering instructions to a computer scales very poorly.
this way of interacting scales very poorly for some tasks.

A **command-line interface** (CLI) allows users to to interact with computer by reading
and writing text. It excels at making repetitive tasks automatic and fast.

A **shell** is a particular program that lets you type commands.
In this workshop, we will be using "Bash" which is the most popular Unix shell.
Bash is often the default shell on Unix and in Unix-like tools for Windows.

### Why use the shell?

Imagine the following task:
for a literature search, you have to copy the third line of one thousand text files in one thousand
different directories and paste it into a single file.

Using a GUI, you would not only be clicking at your desk for several hours,
but you could potentially also commit an error in the process of completing this repetitive task.
This is where we take advantage of the Unix shell.
The Unix shell is both a **command-line interface** (CLI) and a scripting language,
allowing such repetitive tasks to be done automatically and fast.
With the proper commands, the shell can repeat tasks with or without some modification
as many times as we want.
Using the shell, the task in the literature example can be accomplished in seconds.

### The Shell

The shell is a program where users can type commands.
With the shell, it's possible to invoke complicated programs like climate modeling software
or simple commands that create an empty directory with only one line of code.
The most popular Unix shell is Bash (the Bourne Again SHell ---
so-called because it's derived from a shell written by Stephen Bourne).
Bash is the default shell on most modern implementations of Unix and in most packages that provide
Unix-like tools for Windows.
Note that 'Git Bash' is a piece of software that enables Windows users to use a Bash like interface
when interacting with Git.

Using a CLI, you can write a series of commands that does this consistently and nearly instantly.

The shell can be used for simple tasks like creating an empty folder
and for launching (even complex) programs with a single command.
In fact, some tools and resources such as cloud computing systems
usually require users to be familiar with the shell.
Shell commands can be combined together and saved into reproducible *scripts*
that handle large volumes of data automatically.

Using the shell will take some effort and some time to learn.
While a GUI presents you with choices to select, CLI choices are not automatically presented to you,
so you must learn a few commands like new vocabulary in a language you're studying.
However, unlike a spoken language, a small number of "words" (i.e. commands) gets you a long way,
and we'll cover those essential few today.

The grammar of a shell allows you to combine existing tools into powerful
pipelines and handle large volumes of data automatically. Sequences of
commands can be written into a *script*, improving the reproducibility of
workflows.

In addition, the command line is often the easiest way to interact with remote machines
and supercomputers.
Familiarity with the shell is near essential to run a variety of specialized tools and resources
including high-performance computing systems.
As clusters and cloud computing systems become more popular for scientific data crunching,
being able to interact with the shell is becoming a necessary skill.
We can build on the command-line skills covered here
to tackle a wide range of scientific questions and computational challenges.

Let's get started.
While a GUI presents you with choices to select, CLI choices are not automatically presented to you. It can be daunting at first, but once you've come familliar with this different style
of iteracting, you will be able to find and use the information you need to accomplish
a huge variety of tasks.

### Let's get started.

When the shell is first opened, you are presented with a **prompt**,
indicating that the shell is waiting for input.
Expand Down