Skip to content

Linux Commands Cheat Sheet

Search thirteen source-checked GNU/Linux file, text, location, and disk commands and copy conservative templates without destructive flags.

Privacy: your files never leave your device. All processing happens locally in your browser.

How to use

  1. 1.Search by command, category, or task such as disk or first lines.
  2. 2.Read the description and replace every angle-bracket placeholder.
  3. 3.Confirm the working directory, target paths, executable source, and local manual.
  4. 4.Copy and run only with appropriate permissions, then verify the observed result and exit status.

About Linux Commands Cheat Sheet

Linux Commands Cheat Sheet is a focused reference for thirteen common GNU Coreutils commands used to inspect location, work with files, preview text, count and sort lines, and review disk usage. Search by command, category, syntax, or purpose, then copy one template. The list includes pwd, ls, mkdir, cp, mv, cat, head, tail, wc, sort, uniq, df, and du. It intentionally omits shell pipelines, recursive deletion, force flags, privilege escalation, process termination, permission rewriting, package management, and network changes.

Angle-bracket text is a placeholder. Replace <file>, <path>, <source>, <destination>, <directory>, and <sorted-file> with real values and remove the brackets. Shell metacharacters, whitespace, leading hyphens, wildcard expansion, environment variables, and symbolic links can change what a command targets. Quote paths when necessary, use -- before filenames that begin with a hyphen when the utility supports it, and inspect the working directory before any command that writes or moves data. A syntactically valid command can still act on the wrong file.

The copy and move templates include -i so GNU implementations prompt before overwriting an existing destination. That is a guardrail, not a transaction or backup. Interactive behavior can differ in aliases, scripts, noninteractive sessions, and non-GNU systems. mkdir -p creates missing parent directories and normally does not complain when the directory already exists. It cannot guarantee ownership, permissions, mount availability, or that another process did not replace a path between inspection and use.

Text utilities have precise scopes. cat writes file contents to standard output and can flood a terminal with large or binary input. head and tail show twenty lines here, but line delimiters and encodings still matter. wc -l counts newline characters rather than a human definition of records. sort follows the active locale unless configured otherwise. uniq counts only adjacent duplicates, so the shown placeholder explicitly says sorted-file. Preserve original data and review a sample before redirecting transformed output over an important file.

Disk commands report different measurements. 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-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.

This page never opens a terminal, reads a filesystem, executes a command, expands a placeholder, or uploads repository data. Copying text is the only side effect. The thirteen rows are checked for unique identifiers and command strings, and eight templates are fixed against the GNU manual with POSIX utility documentation as an independent cross-check. Options and output can differ on BSD/macOS, BusyBox, containers, minimal images, or older distributions, so consult the local man page and command --help after verifying the executable source.

Use the least privilege needed and avoid pasting secrets into commands, shell history, filenames, or screenshots. In scripts, handle exit status, quote variables, set explicit working directories, and choose idempotent operations. Back up material data before mutations and verify the result afterward. This cheat sheet is a learning and recall aid, not authorization to operate an unfamiliar server. When a command could overwrite, disclose, move, or consume important data, stop and resolve the exact target first.

Methodology & sources

Stores thirteen non-destructive GNU Coreutils templates with unique IDs and commands, filters normalized category/syntax/description text, and copies exactly one displayed template without filesystem or shell access.

Frequently asked questions

Should I type the angle brackets?
No. Replace the entire placeholder including brackets, and quote shell-sensitive paths correctly.
Why are rm and force flags missing?
Context-free destructive commands can discard data and do not belong in a quick-copy reference without target and recovery checks.
Will every command behave the same on macOS or BusyBox?
No. This sheet targets GNU Coreutils concepts; options and output can differ, so check the local implementation documentation.

Developer Tools guides

View all