Tux Notes

March 2, 2026

Getting comfortable with the shell

The terminal looks intimidating at first, but a handful of commands covers most daily work.

Where am I?

Every shell session has a current working directory. Print it with pwd, list its contents with ls -lah and move around with cd. Running cd with no argument takes you back to your home directory, and cd - jumps to the previous one.

Reading files

Use cat for short files, less for long ones (press q to quit, / to search) and head/tail to peek at the beginning or end. tail -f /var/log/syslog follows a log as new lines arrive.

Pipes

The real power of the shell is composition. The pipe | sends the output of one program into the next:

ls -1 /usr/bin | wc -l
history | grep ssh | tail -5

Small tools that do one thing well, chained together, solve surprisingly large problems.

Getting help

Almost every command documents itself. Try man ls, ls --help or apropos copy when you cannot remember a command name.

← All lessons