02. The File System and the Shell

Published

Wednesday, September 4, 2024

This week …

A shell is how we talk to the operating system; it is the thing that executes programs of all kinds for us when we tell it to; and it is how we see where we are in the file system and act on those files. In a plain-text world we will spend quite a bit of time talking to the shell via a command-line interface. This week we see the elements of how to do that, and what it buys us.

The shell’s interface is is a command interpreter. Languages like R and Python work in the same way when you are writing them. We will also see how the shell implements its own version of the sort of thing you may have already seen when using R, namely, many single-purpose commands (more or less equivalent to R’s functions) that can be chained or pipelined together into sequences that can do quite complex tasks one piece at a time.

Readings

After you have completed this week’s assignment, you may want to read the first chapter of Daniel J Barrett Efficient Linux at the Command Line (Sebastopol, CA: O’Reilly Media, 2022).

Video

  • Five minutes from Jenny Bryan on how to name things:
  • The Unix way of thinking. You can watch the whole video for a really great dose of 1970s/1980s Corporate Video Nostalgia (and a lot of useful information), but in particular watch the seven minutes from about 04:56 in, when Brian Kernighan (the guy in the blue pullover) explains the idea of the Unix way of thinking, and gives an example.

Examples

This week’s examples and demos.

Assignment

This week’s assignment.

Slides

View all slides in new window