Linux Commands Cheatsheet
Linux and Bash command reference — navigation, files, processes, networking, text processing, and scripting.
What it does
8 sections, 70+ commands
Covers navigation, files, viewing, search/text, processes, networking, scripting, and archives.
Real-world flags
Commands show the flags you actually use — e.g., 'ls -la', 'grep -rn', 'tar -xzf'.
Destructive-command warnings
rm -rf, kill -9, and other irreversible commands are flagged with explicit notes.
How to use Linux Commands Cheatsheet
- 1Find your command
Search by keyword (e.g., 'grep', 'process', 'archive') or browse sections.
- 2Check the example
Most commands include real-world examples with flags that actually matter.
- 3Copy and run
Click copy and paste directly into your terminal. Replace placeholders in angle brackets.
- 4Note the warnings
Commands like rm -rf and kill -9 are marked with destructive-operation notes.
Frequently Asked Questions
What is the difference between grep, sed, and awk?
- grep searches for lines matching a pattern. sed is a stream editor for simple substitutions and line operations. awk is a full text-processing language best for field extraction and calculations. For a quick find, use grep. For find-and-replace, use sed. For column operations, use awk.
How do I run a command in the background?
- Append & to the command: 'my-command &'. Use 'jobs' to list background jobs. 'fg' brings the most recent job to the foreground. For commands that should survive logout, use 'nohup my-command &'.
What is the difference between > and >> for redirection?
- > redirects stdout to a file, overwriting it if it exists. >> appends to the file. 2>&1 redirects stderr to wherever stdout is going. Use 'command > out.log 2>&1' to capture all output including errors.
How do I find large files taking up disk space?
- Use 'du -sh *' to see the size of items in the current directory. Pipe through sort: 'du -sh /* | sort -rh | head -20' to find the 20 largest directories.
Related Tools
Git Cheatsheet
Essential Git commands — setup, branching, merging, remotes, undoing changes, and more. Search and copy instantly.
Vim Cheatsheet
Vim modes, navigation, editing, search & replace, macros, and essential config. Search and copy instantly.
Cheatsheet Hub
Interactive cheatsheets for Git, CSS, Linux, React, Vim, and more. Search, filter, and copy commands instantly.
Vim Adventure
Learn Vim by playing. Free browser-based game with 25 levels teaching hjkl, word motions, search, deletion, and more. No signup, no paywall, progress saved locally. Best free Vim Adventures alternative.
CSS Cheatsheet
Quick reference for CSS selectors, Flexbox, Grid, typography, animations, and modern CSS. Search and copy instantly.