A quick reference for the whole Linux track: command, what it does and an example. Technical terms stay in English, as at work.
General command pattern
| Command | What it does |
|---|---|
Commandcd dir; ls | What it does; — run in sequence, even if the previous one failed |
Commandmkdir proj && cd proj | What it does&& — runs only if the previous one succeeded |
Commandping -c1 host || echo "down" | What it does|| — runs only if the previous one failed |
Commandlong-task & | What it does& — run in the background |
Commandcmd1 | cmd2 | What it does| — output of one becomes input of the next |
CommandTAB | What it doesAuto-complete commands, files and paths |
Commandhistory / !100 | What it doesCommand history; !100 re-runs line 100 |
Commandls -la | What it doesShows hidden files too (names starting with a dot) |
📁 Files and directories
| Command | What it does |
|---|---|
Commandls -la | What it doesList directory contents with details and hidden files |
Commandcd /var/log · cd ~ · cd - | What it doesChange directory; ~ home, - back to previous |
Commandpwd | What it doesCurrent path |
Commandmkdir -p a/b/c | What it doesCreate a directory including parents |
Commandrm -r dir · rm -f file | What it doesDelete — there is no recycle bin! |
Commandcp -r src/ dst/ | What it doesCopy |
Commandmv old.txt new.txt | What it doesMove or rename |
Commandln -s target link | What it doesCreate a symbolic link |
Commandtouch file.txt | What it doesCreate a file or update its timestamp |
🔍 Searching
| Command | What it does |
|---|---|
Commandgrep -r "error" /var/log | What it doesSearch text inside files |
Commandfind / -name "*.conf" 2>/dev/null | What it doesFind files by attributes |
Commandlocate passwd | What it doesFast search from a database (needs updatedb) |
Commandwhich python3 | What it doesWhere a command lives |
Commandgrep Failed auth.log | cut -d' ' -f11 | sort | uniq -c | sort -rn | head | What it doesTypical log chain: who failed to log in most often |
⚙️ Processes
| Command | What it does |
|---|---|
Commandps aux · ps aux | grep nginx | What it doesRunning processes |
Commandkill -9 PID | What it doesStop a process (-9 = SIGKILL, last resort) |
Commandkillall firefox | What it doesStop by name |
Commandtop · htop | What it doesLive view and process management |
Commandjobs · fg %1 · Ctrl+Z → bg | What it doesMove jobs between background and foreground |
🔐 Permissions
| Command | What it does |
|---|---|
Commandchmod 644 file · chmod u+x script.sh | What it doesChange permissions |
Commandsudo chown user:group file | What it doesChange owner |
Commandumask | What it doesDefault mask: 022 = files 644 |
Commandid alice · groups | What it doesWho am I and which groups |
🗜️ Archives and compression
| Command | What it does |
|---|---|
Commandtar -czvf a.tar.gz dir/ | What it doesCreate a compressed archive |
Commandtar -xzvf a.tar.gz -C /restore/ | What it doesExtract |
Commandtar -tzvf a.tar.gz | What it doesList contents — before extracting! |
Commandgzip -k file.log · gunzip | What it doesCompress one file (-k keeps the original) |
Commandzcat log.gz | tail | What it doesView a compressed file |
🌐 Network
| Command | What it does |
|---|---|
Commandping -c 4 8.8.8.8 | What it doesReachability and latency |
Commandip a · ip r | What it doesIP addresses and routing table |
Commandss -tulpn | What it doesOpen ports and the listening process |
Commanddig +short example.com · nslookup | What it doesDNS query |
Commandcurl -I https://site.com | What it doesHTTP check |
Commandwget -O out.zip URL | What it doesDownload a file |
Commandssh -p 2222 user@host | What it doesRemote login |
Commandscp file user@host:/tmp/ | What it doesCopy over SSH |
💻 System info
| Command | What it does |
|---|---|
Commanduname -a | What it doesKernel and system version |
Commandcat /etc/os-release | What it doesWhich distribution is installed |
Commanddf -h | What it doesDisk usage — the most important! |
Commanddu -sh /var/* | What it doesWhat takes up space |
Commandfree -h | What it doesMemory (cache is not really used memory) |
Commanduptime | What it doesUptime and load average |
Commandwho · w | What it doesWho is logged in |
Commandjournalctl -p err --since today | What it doesToday's errors |
⌨️ Terminal shortcuts
| Command | What it does |
|---|---|
CommandCtrl+C | What it doesStop the current command |
CommandCtrl+Z | What it doesSuspend to background (fg to resume) |
CommandCtrl+R | What it doesReverse history search |
CommandCtrl+L | What it doesClear the screen (like clear) |
CommandCtrl+A · Ctrl+E | What it doesStart / end of line |
CommandCtrl+U · Ctrl+K | What it doesDelete line backward / forward |
CommandCtrl+D | What it doesExit / EOF (careful as root!) |
Command!! · sudo !! | What it doesRepeat last command; or with sudo |
✏️ Vim survival
| Command | What it does |
|---|---|
CommandEsc → :wq | What it doesSave and quit |
CommandEsc → :q! | What it doesQuit without saving |
Commandi | What it doesEnter insert mode |
Command/text + Enter · n | What it doesSearch; n for next match |
Commanddd · u · Ctrl+R | What it doesDelete line, undo, redo |
Commando · O | What it doesNew line below / above |
Command:N · G · gg | What it doesJump to line N / end / start |
