A Linux commands cheat sheet should separate discovery from execution: an online reference finds the command, while the command line verifies and applies it on your system.
For the Linux Commands Cheat Sheet, that distinction is exact: it is a searchable reference for 13 GNU Coreutils commands, not a live terminal. The page never opens a terminal, reads a filesystem, executes a command, expands a placeholders, or uploads repository data; copying text is its only side effect. You run a copied template yourself in a trusted shell with suitable permissions, then inspect the output and exit status.

Command line and online reference: different jobs
Use the command line when an answer depends on current files, installed utilities, permissions, or live output. Use an online sheet for recall and to locate a conservative template. This product stops at the copied command, so it cannot change the computer where you read it.
| Question | Command line | This online sheet |
|---|---|---|
| Execution | Runs an installed utility against a working directory and its files. | Displays a template only; it never runs the command. |
| Current state | Reflects actual paths, permissions, file contents, and the installed implementation. | Provides fixed descriptions, syntax, placeholders, and safety notes without inspecting your system. |
| Portability | Depends on the local GNU, BSD, BusyBox, container, or other implementation. | Uses GNU Coreutils concepts, so local documentation still matters. |
| Feedback | Produces actual output and an exit status for verification. | Helps you choose what to run before any command reaches a shell. |
Keep both layers in the loop: retrieve one template online, resolve its paths in the command-line environment, then run and verify it locally. The terminal remains the authority for the actual environment, not the webpage. Before writing or moving data, confirm the exact working directory, target paths, executable source, and local manual. A syntactically valid command can still act on the wrong file.
What this Linux reference covers
The focused set covers location, directory creation, file transfer, text preview, line analysis, and disk measurement:
| Task | Commands | Primary use | Important boundary |
|---|---|---|---|
| Location | pwd, ls | Inspect the current directory and list directory entries. | The result reflects the active working directory and local utility options. |
| Directory creation | mkdir | Create a directory. | mkdir -p creates missing parents and normally accepts an existing directory, but it cannot guarantee ownership, permissions, mounts, or protection from a path being replaced. |
| File transfer | cp, mv | Copy or move files and directories. | The GNU templates include -i, which prompts before overwriting an existing destination; it is not a transaction or backup. |
| Text preview | cat, head, tail | Write file contents to standard output or show the beginning or end of a file. | cat can flood a terminal with large or binary input. The sheet's head and tail templates show twenty lines. |
| Line analysis | wc, sort, uniq | Count lines, order text, and identify adjacent duplicate lines. | wc -l counts newline characters, sort follows the active locale, and uniq only compares neighboring lines. |
| Disk usage | df, du | Report file-system space or blocks attributed to a selected path. | These commands measure different things, so their totals can disagree. |
The scope is intentionally narrow. The sheet omits shell pipelines, recursive deletion, force flags, privilege escalation, process termination, permission rewriting, package management, and network changes. That makes it a learning and recall aid, not authorization to operate an unfamiliar server. If a command could overwrite, disclose, move, or consume important data, stop and resolve the exact target first.
Find, check, and run a command safely
- Search for one command or task. Open the Linux Commands Cheat Sheet and search by command, category, syntax, purpose, or a task such as disk usage or first lines. Select one displayed template. Searching and copying remain entirely inside the webpage; no shell command is sent or run.
- Replace every placeholder. Read the description and safety notes before copying. Replace placeholders such as <file>, <path>, <source>, <destination>, <directory>, and <sorted-file> with real values, then remove the brackets. Shell metacharacters, whitespace, leading hyphens, wildcard expansion, and environment variables can change the target. Quote paths when necessary and use -- before filenames beginning with a hyphen when the utility supports it.
- Confirm the real target and implementation. Inspect the working directory, source, destination, and any relevant symbolic links. Verify where the executable comes from and read its local manual or --help output. A relative path can mean different things in different directories, while a symbolic link can point somewhere other than its displayed location. Resolve ambiguity before running the template.
- Review every write or move. Back up material data before mutation. The -i option in the GNU copy and move templates prompts before replacing an existing destination, but that prompt does not roll back a completed change or preserve the overwritten file. Interactive behavior can also differ in aliases, scripts, noninteractive sessions, and non-GNU systems. Do not continue while the exact destination remains uncertain.
- Run with least privilege and verify. Paste one reviewed template into a trusted shell, use only the permissions needed, and avoid placing secrets in commands, shell history, filenames, or screenshots. In scripts, quote variables, set an explicit working directory, handle the exit status, and prefer idempotent operations where possible. Afterward, inspect the observed output and exit status instead of assuming that a valid-looking command changed the intended data.
Read each command in its precise scope
Several common Linux commands are easy to misuse because their names suggest a broader meaning than their actual behavior:
- cat writes a file's contents to standard output. Large files or binary input can overwhelm the terminal.
- head and tail show twenty lines in this sheet, but line delimiters and character encodings can affect where a line appears to begin or end.
- wc -l counts newline characters rather than a human-defined number of records.
- sort follows the active locale unless that behavior is configured otherwise.
- uniq counts only adjacent duplicate lines. Its <sorted-file> placeholder must refer to genuinely sorted input if duplicates need to be found across the file.
Preserve the original data and review a sample before redirecting transformed output over an important file. A text utility can be syntactically correct while producing output that does not match your intended definition of a record or duplicate.
Compare disk measurements before acting
df -h summarizes space for mounted file systems using human-readable units. du -sh estimates the total blocks attributed to a selected path. Their totals can differ because deleted-but-open files, sparse files, hard links, permissions, mount boundaries, snapshots, reserved blocks, and file-system accounting affect what each command sees.
Neither command alone proves that a cleanup is safe. If disk pressure is urgent, identify the exact consumer and preserve recoverability before deleting anything. Because the reference deliberately omits deletion commands, its disk templates help with measurement rather than authorizing a cleanup.
Check portability before relying on a template
The sheet's 13 rows are checked for unique identifiers and command strings, and eight templates are fixed against the GNU manual with the POSIX utilities documentation as an independent cross-check. These checks support the documented GNU behavior, but they do not make every Linux environment identical. Options and output can differ on BSD or macOS, BusyBox, containers, minimal images, and older distributions.
After verifying the executable source, consult the local manual and the command's --help output. Check aliases, scripts, noninteractive behavior, and the active locale where relevant. Keep paths quoted, confirm symbolic-link targets, and use the least privilege needed. The online reference can shorten discovery, but the local implementation determines what actually happens.
Pick the right source for each part of the job
Use the online cheat sheet to find, compare, and copy a safe starting point; use the command line and local documentation to establish current truth, execute the command, and verify the result. For example, search online for the disk commands, read their different measurement scopes, then run the appropriate command from the intended directory. The website should remain a reference rather than pretending it inspected your machine.
For a wider command-by-command walkthrough of the same 13 templates, see Basic Linux Commands: 13 Safe Templates to Copy. The operating rule remains simple: retrieve online, resolve locally, run with least privilege, and verify afterward.