25 lines701 B

Lesson 3: Pipes and redirection

Pipes and redirection comes up in almost every real shell project. We start with the why, then write code together.

Full lesson: https://glibcode.net/courses/linux-shell/lessons/3

Files

  • words.sh: a pipeline that counts the most common words

Tip: history | grep ssh finds that command you typed last week.

Tip: man pages are long; tldr <command> gives you the common cases.

Tip: Quote your variables: "$file" survives spaces in names, $file doesn't.

Run it

sh words.sh

Exercises

See exercises.md. Ask in the forum after you have tried.