Linux Terminal Basics: What to Learn First and How to Use a Command Cheat Sheet
Updated
Linux terminal basics are the small set of concepts and commands that let you work in a text console: you type a command, the shell interprets it, and the system returns output or an error. Start with four areas — files and folders, users and groups, system information, and package management — and learn to check syntax with man or --help before running anything unfamiliar. A cheat sheet such as the one on Linux Command Library is a lookup index, not a tutorial: it lists categories (One-liners, System information, System control, System Recovery, Users & Groups, Files & Folders, Network, Search & Find, Git, SSH, Text Processing, Compression & Archiving, Backup & Imaging, Shell Scripting, and more) so you can find the right command name, then read its manual page for the details that matter on your machine.
Terminal, shell, and prompt: who does what
Three things are easy to conflate:
- Terminal — the window or console that displays text and sends your keystrokes to a program.
- Shell — the program that reads your line, expands it (paths, variables, wildcards), and runs the resulting command. Bash is the common default; others exist.
- Prompt — the shell's signal that it is ready for input. It often shows your username, hostname, and current directory, which is why a wrong-looking prompt is your first clue that you are in the wrong place.
The practical consequence: when a command fails, decide whether the problem is the command itself (shell could not find or parse it) or the environment (wrong directory, missing permission, program not installed). The error text usually tells you which.
The first four categories to learn
| Category | What you learn | Typical first commands |
|---|---|---|
| Files & Folders | Where you are, what is there, how to move and copy | pwd, ls, cd, cp, mv, rm, mkdir |
| Users & Groups | Who you are and what you may do | whoami, id, groups |
| System information | What the machine is and how it is doing | uname -a, df -h, free -h, uptime |
| Package manager | How software is installed on this distribution | apt, dnf, or pacman — whichever your system uses |
Learn these in order. File navigation comes first because every other command takes a path, and a path mistake is the most common beginner error.
How to read a cheat sheet without breaking things
A cheat sheet entry is a command name plus a short description, sometimes with a one-line example. Treat each entry as a question to answer before you run it:
- What does it change? Read-only commands (
ls,df,uname) are safe to try. Commands that write, move, or delete (rm,mv,dd) need a plan. - What are its arguments? Check the manual for the exact syntax rather than guessing from the example.
- What is the blast radius? A command with a path argument affects that path. Confirm the path with
pwdandlsfirst.
For one-liners, the same rule applies more strictly: a one-liner is several commands joined by pipes (|) or &&, so an error in the middle can still leave earlier steps applied. Run the pieces separately the first time, then combine them once each part behaves as expected.
Looking up syntax: man and --help
Two lookups cover most needs:
man ls # full manual page: description, options, examples
ls --help # short summary of options, usually faster to scan
Inside man, use the arrow keys or Page Up/Down to scroll, /pattern to search, and q to quit. If man reports no entry, the command may not be installed, or it may be a shell builtin — try help cd for builtins in Bash.
Expected result: you get the option list and, for most tools, a short usage line showing required and optional arguments. If the usage line does not match what you typed, fix the command before running it again.
Common beginner mistakes and how to avoid them
- Running commands from the wrong directory. Check with
pwdbefore any command that takes a relative path. - Assuming permission errors mean "broken." A "Permission denied" message usually means your user lacks rights to that file or directory; check with
idandls -lrather than reaching for elevated privileges reflexively. - Deleting without a dry run. For bulk operations, list the targets first (
lswith the same pattern) and only then run the destructive command. - Copying a command from a cheat sheet without reading its options. Flags change behavior substantially; confirm each flag in the manual.
- Mixing distributions. Package manager commands differ between Debian-based and Red Hat-based systems; use the one your system ships with.
A workable first session
Open a terminal and run, in order: pwd, ls -l, cd into a directory and back, whoami, id, uname -a, df -h. Then look up one command you have not used with man. That sequence exercises navigation, identity, system state, and lookup — the loop you will repeat for every new command. Keep the cheat sheet open as an index of what exists, and let the manual supply the specifics.