If you have not used a terminal before, the most useful thing you can know is that the terminal is just a window that shows text and accepts typed commands. There is nothing mystical about it. Once you accept that "this is a text app," every command that follows is just words you type, output you read, and decisions about what to do next.
Two words you will hear constantly: terminal and shell. They are not the same thing. The terminal is the window; the shell is the program running inside it that interprets your commands.
Terminal vs shell
Terminal
The app that draws characters on your screen and reads what you type from the keyboard. On Linux: gnome-terminal, konsole, xterm. On macOS: Terminal.app, iTerm2. On Windows: Windows Terminal, ConEmu.
Historically these emulated physical hardware terminals (DEC VT100). Most modern terminals still respect the VT100/xterm escape codes for color and cursor positioning.
Shell
The program that runs inside the terminal and interprets the text you type as commands. The shell parses your input, finds the right program to run, and prints output back. On Linux/macOS the default is usually bash or zsh. On Windows: cmd.exe, PowerShell, or any Unix shell via WSL.
The shell is also a small programming language. Variables, loops, conditionals, functions — shell scripts are the original DevOps glue.
Day to day, you don't have to keep them straight. People say "terminal" when they mean either. But when you read documentation that says "set this in your shell's rc file" or "your terminal emulator must support 256 colors," you'll know which layer is being discussed.
Common shells
| Shell | Found on | Notes |
|---|---|---|
| bash | Most Linux distros (default), older macOS | The default for two decades. Massive script library. Slightly clunky syntax but universal. |
| zsh | Default on macOS since 2019 | Bash-compatible with much better autocompletion, prompt themes (oh-my-zsh), and history. The modern default. |
| fish | Optional install everywhere | Friendliest interactive shell. Autosuggestions out of the box. Not POSIX-compatible — scripts written for bash won't always work. |
| sh | Every Unix system | The POSIX-standard shell. Minimal. Often a symlink to bash or dash. Used for portable scripts. |
| PowerShell | Default on Windows; available on Linux/macOS | Object-oriented (passes structured data between commands, not text). Excellent for Windows administration. |
| cmd.exe | Legacy Windows | The original DOS-style command prompt. Avoid for new work; use PowerShell or WSL instead. |
For this course, assume bash unless told otherwise. Every example we write will work in bash. Most will work in zsh and sh too.
Reading the prompt
The shell shows you a "prompt" before each command to indicate it's ready for input. The default prompt looks something like this:
Four pieces of information in one line:
alice— the user you're logged in as.workstation— the hostname of the machine you're on. Useful when you have SSH sessions to several boxes open.~/projects/cyberlab— your current working directory. The~is shorthand for your home directory.$— the trailing character that says "I'm ready." A dollar sign means you're a normal user. A hash (#) means you're root.
$, that means "run this as a normal user." A leading # means "run this as root." Don't type the $ or #! They're indicators, not part of the command.Your first commands
Four commands that work on every Unix system, and that you'll type a few times before this page is over:
whoami— what user am I logged in as? (Useful when you've sudo'd somewhere and forgotten.)hostname— what machine am I on? (Useful for SSH sessions, screenshots, "is this prod?")pwd— "print working directory" — where am I in the filesystem?date— current date and time. Useful as a timestamp in lab logs.
How to get help
Two patterns cover 95% of "what does this command do?" questions:
--help is fast and works for almost every command. man is the full manual — sometimes more than you wanted, but always authoritative. Inside man, the keystrokes are simple: j/k or arrow keys to scroll, / to search, n for next match, q to quit.
A third option worth knowing:
tldr isn't installed by default but is one apt install tldr away. It gives you the three or four most common usages of a command instead of every flag. Often more useful than the full manual for getting started.
Keyboard shortcuts that matter
- Tab — autocomplete. Press once to complete; press twice to list options. The single biggest productivity gain in the terminal.
- Up arrow / Ctrl+P — previous command in history.
- Down arrow / Ctrl+N — next command in history.
- Ctrl+R — search backward through history. Type a few characters; the shell shows the most recent match. Hit Ctrl+R again for the next match.
- Ctrl+C — interrupt the running command (send SIGINT).
- Ctrl+D — end of input. At a blank prompt, this exits the shell.
- Ctrl+L — clear the screen (same as typing
clear). - Ctrl+A / Ctrl+E — jump to beginning / end of the current line.
The terminal is a text window. The shell is the program inside it. Most of what feels intimidating about the terminal is just unfamiliarity with a handful of conventions — the prompt, the keyboard shortcuts, where to find help.
Get comfortable with Tab completion, man/--help, and the four "where am I" commands above. Everything else in this section — navigation, recording, multiplexing — builds on that base.
References
Formatted in APA 7. Alphabetized by first author's last name.
- GNU Project. (n.d.). Bash reference manual. Free Software Foundation. https://www.gnu.org/software/bash/manual/
- IEEE & The Open Group. (2018). The Open Group Base Specifications Issue 7, 2018 edition (POSIX.1-2017). https://pubs.opengroup.org/onlinepubs/9699919799/
- Newham, C. (2005). Learning the bash shell: Unix shell programming (3rd ed.). O'Reilly Media.
- tldr-pages contributors. (n.d.). tldr-pages: Simplified and community-driven man pages. https://tldr.sh/