Count a stream
Quest: count-stream
Mission
Use a pipeline to count the distinct login shells in /etc/passwd.
Commands You Will Use
cutsortwc
This quest also uses pipe syntax. The pipe is shell syntax, not a command card.
Steps
- Run
cut -d: -f7 /etc/passwdto print one login shell per line. - Run
cut -d: -f7 /etc/passwd | sort -uto keep distinct shells. - Run
cut -d: -f7 /etc/passwd | sort -u | wc -lto count them. - Ask the guide to check your work.
Hints
wc -lcounts lines.sort -usorts lines and removes duplicates.- Use
cut,sort -u, andwc -lin one pipeline.
If Check Fails
Run the pipeline again, then ask the guide to check it.

Linux Foundations