Linux & Shell

Drive the machine from a prompt

A shell is not a worse window manager — it is a small language for pointing programs at files. This is the whole of the interactive half: resolving a path, setting a mode, sending each of the two output streams where you meant it, cutting a file down to an answer, and chaining commands on their verdicts.

Modules
5
Drills
1
Build steps
5
Time
~4h

Walk out able to

Answer a real question about a real file with one line you wrote yourself — and know which of the two streams the errors went down.

What you work on

01

Paths and expansion

Resolve any path; predict what a glob hands over.

02

Modes and who gets in

Read `ls -l` at a glance; set 754 without guessing.

03

Two streams and a pipe

Redirection, and why the order of 2>&1 decides it.

04

Text tools and control

grep, sed, awk; exit status, quoting, and jobs.

What you get

Skills that stick

Every project mixes short lessons, focused drills and real build steps, so you finish with working code and the judgement behind it.

You will practise

  • Paths, globs, links and finding things
  • Modes, chmod, and who may do what
  • Redirection, pipes, grep, sed and awk
  • Exit status, quoting and job control

Afterwards you can

  • Resolve any path without writing it down
  • Set a mode from memory, either direction
  • Order 2>&1 correctly, and know why
  • Compose four tools into one pipeline

Modules

Step by step

Each module builds on the last. Read a short lesson, drill it until it's second nature, then put it to work.

  1. 1

    Find your way around

    ~52 min

    Turn any path into the one place it names, and find a file you cannot see.

    • LessonWhy drive a machine from a prompt4 min
    • Build stepBuild a tree of your own to ruin6 min
    • LessonRead a path to the one place it names9 min
    • LessonWhy a relative path is a bug report7 min
    • LessonLet the shell pick the files9 min
    • LessonReach for find when a glob cannot6 min
    • Build stepGive one file two names11 min
  2. 2

    Read and set a mode

    ~47 min

    Read `ls -l` at a glance, and set a mode with chmod without guessing.

    • LessonRead the ten characters at the front7 min
    • LessonTranslate a mode, either direction10 min
    • LessonDelete a file you cannot read9 min
    • LessonChoose a mode from a requirement9 min
    • Build stepMake a script runnable, then undo it12 min
  3. 3

    Wire the two streams

    ~46 min

    Send each stream where you meant it, and know why the order of `2>&1` decides it.

    • LessonTwo streams arriving on one screen8 min
    • LessonWrite 2>&1 in the order you meant10 min
    • LessonWhat travels down a pipe7 min
    • LessonWork a pipeline out stage by stage9 min
    • Build stepSplit the streams, then swap the order12 min
  4. 4

    Cut the file down to the answer

    ~33 min

    Pull the lines and the fields you need with grep, sed and awk.

    • LessonSelect the lines you actually meant8 min
    • LessonKnow which dialect you are in9 min
    • LessonSubstitute, and print everything8 min
    • LessonTake a column out of every line8 min
  5. 5

    Make the shell obey

    ~1h

    Chain commands on their verdicts, quote what you mean, and write the one-liner.

    • LessonRead the verdict, not the message7 min
    • LessonChain commands on their verdicts9 min
    • LessonSay exactly what you meant9 min
    • LessonWhat a program you start inherits7 min
    • LessonPut a job aside and pick it up again12 min
    • DrillFind the line that does not mean it8 min
    • Build stepAnswer a question with one line18 min

A taste of the code

one line, two streams
# notes.md is there; missing.md is not
ls notes.md missing.md > found.txt 2>&1

$ cat found.txt

ls: cannot access 'missing.md': No such file or directory
notes.md

Ready when you are.

Work through it at your own pace and pick up right where you left off.