Keep a pipeline copy
Quest: keep-pipeline-copy
Mission
Extract login shells, save the stream with tee, and count its lines.
Commands You Will Use
mkdircutteewccat
This quest also uses pipe syntax.
Steps
- Run
mkdir -p ~/playgroundif the directory is missing. - Run
cut -d: -f7 /etc/passwd | tee ~/playground/login-shells.txt | wc -l. - Run
cat ~/playground/login-shells.txtand confirm it contains shell paths. - Ask the guide to check your work.
Hints
cut -d: -f7selects the login-shell field.teecopies stdin to the file and also sends it onward through stdout.- The exact pipeline and
~/playground/login-shells.txtare both checked.
If Check Fails
- If the command is missing, run the complete pipeline exactly as shown.
- If the file is missing or empty, run each stage alone, then reconnect the pipeline.
- If
~/playgroundis missing, create it withmkdir -p ~/playground.

Linux Foundations