How to use the Linux Commands Cheat Sheet
- Type your own values (folder, file, user, host) in the boxes at the top — every example on the page updates instantly.
- Search or jump to a section to find the command you need.
- Click Copy to copy a ready-to-run line, or Copy section for a commented block.
- Commands marked destructive delete or overwrite data — read the note before running them.
Pipes are the superpower
Most Linux tools do one thing and read from standard input, so you combine them with |. grep filters lines, awk and cut pick columns, sort and uniq -c count, head trims. Redirect output with > (overwrite), >> (append) and 2>&1 (include errors).
Be careful with these
rm -rfdeletes without a recycle bin. Uselson the exact path first, and never run it with an unset variable such asrm -rf $DIR/.sed -i,find -deleteandrsync --deletechange files in place — run them without the destructive flag first to preview.kill -9skips cleanup; try a normalkillfirst.
Permissions at a glance
Read is 4, write is 2, execute is 1; add them per owner, group and others. So 640 means owner read/write, group read, others nothing. Work out any value with the chmod calculator, generate cron schedules with the cron expression generator, and check open ports remotely with the port checker.
Tools that pair well with the Linux Commands Cheat Sheet
- Docker Cheat Sheet — The Docker and Docker Compose commands you reach for every week, explained in one line.
- Git Cheat Sheet — Every Git command you use day to day — and the ones you need when something goes wrong — explained in one line.
- Nginx Config Generator — Choose what Nginx should do — serve a static site or SPA, proxy to a Node/Python app, or run PHP — and tick the extras.
- AI Prompts for Developers — Battle-tested prompts for the coding tasks you do every day — debugging, reviews, tests, refactoring, SQL, commit messages and documentation.
Frequently asked questions
How do I find which process is using a port?
sudo lsof -i :8080 or sudo ss -tulpn | grep 8080. Both show the process name and PID.What do chmod 644 and 755 mean?
How do I keep a command running after I close SSH?
nohup command & for a quick job, a terminal multiplexer such as tmux or screen for interactive work, or a systemd service for anything that should run permanently.Do these commands work on macOS?
sed -i needs an empty string argument (sed -i ''), there is no systemd or journalctl, and packages come from Homebrew.