Find your feet in the terminal
By the end: Find your current location, inspect a directory, and discover help without guessing.
The idea
A terminal is the interface; Bash is the shell interpreting your input. Commands usually follow command → options → arguments. A relative path starts at your current directory; an absolute path starts at /. Case matters: Notes and notes can be different files. The examples use Bash on GNU/Linux; optional programs may need your distribution's packages.
Your command toolkit
pwd
What it solves: Know which directory a command will affect.
pwd
Prints your working directory. Check it before changing files; a relative filename is resolved here.
ls
What it solves: Inspect visible and hidden files.
ls -lah
-l shows details, -a includes dotfiles, and -h makes sizes readable. A leading dot hides a name from the default listing, not from access.
cd
What it solves: Move between directories.
cd /tmp
pwd
cd -
cd changes the current shell's directory. cd - returns to the previous directory; cd with no argument goes home.
dir
What it solves: Read another form of directory listing.
dir .
GNU dir is similar to ls but normally formats entries in columns. Prefer ls in shared instructions because it is more familiar.
clear
What it solves: Make room for the next investigation.
clear
Clears the display on supported terminals. It does not delete your command history or guarantee removal of terminal scrollback.
help
What it solves: Understand a Bash builtin.
help cd
Builtins execute inside the shell. Bash help documents them; it is different from an external program's --help option.
man
What it solves: Read the installed program's manual.
man ls
Press / to search, n for the next match, and q to leave the pager. Manual sections distinguish commands, files, and system calls.
whatis
What it solves: Get a one-line command description.
whatis ls
Uses the local manual database. An empty result can mean missing manuals or an outdated index, not a missing executable.
apropos
What it solves: Find a command when you only know the job.
apropos directory
Searches manual descriptions by keyword. Start with a broad word, then read the matching manual before trying options.
Before you move on
Try the guided lab below. Compare the result with the explanation, then record your reasoning in the workbook. A missing optional program or a restricted environment is something to explain, not a reason to change system settings blindly.
Practice with evidence
- Predict the result
- Run the guided lab
- Compare the output
- Explain your choice
A worked example
Guided lab
pwd
ls -ld . /tmp
help pwd
What to expect: Two directory entries and help for pwd. Your current path will differ from another learner's.
Make it yours: Record your starting path, explain what . and .. mean, and name one option you discovered in help or a manual.
Read further
- GNU Coreutils manual ↗www.gnu.org
Apply what you learned
Your private practice
Answers are private. Completion requires the correct knowledge-check answer and a written response when an activity is included.
Restore a downloaded workbook
Choose a recovery file for this course and version. Review the recovered copy before saving it to your account.
Ask a question or report a problem
Describe what needs attention. Your private answer is shared only if you select the option below.