Back to More
CLI Power

Terminal Shortcuts Every Dev Should Know

Stop clicking. Start flying.

⌨️ Essential Shortcuts

ctrl + r

Reverse search through your command history. Start typing and matching commands appear. Saves hours of pressing up-arrow.

ctrl + w

Delete the word before the cursor. Faster than holding backspace.

ctrl + u

Clear the entire line before the cursor. Useful when you mess up a long command.

ctrl + a / ctrl + e

Jump to the beginning (A) or end (E) of the line. Stops you from holding arrow keys.

!!

Re-run the last command. Great for: `sudo !!` when you forget to sudo.

!$

Reuse the last argument of the previous command. `mkdir new-project && cd !$`

🛠️ Power Commands

grep -r

Search recursively in files. `grep -ri 'function' src/` — case-insensitive search across all files.

find

Find files by name. `find . -name '*.tsx'` — list all TSX files in current directory.

sed

Find and replace across files. `sed -i 's/old/new/g' file.txt` — replace all occurrences.

curl

Make HTTP requests from the terminal. `curl -I https://example.com` — check response headers.

history | grep

Search your command history. `history | grep docker` — find that docker command you ran yesterday.

ps aux | grep

Find running processes. `ps aux | grep node` — check if your Node server is still running.

One-Liner Tricks

find . -type f -name "*.log" -exec rm  \;

Delete all .log files in the current directory tree.

tar -czf archive.tar.gz folder/

Compress a folder into a .tar.gz archive.

alias gs="git status"

Create a permanent shortcut. Add to your ~/.bashrc or ~/.zshrc.

The One Tool Worth Installing

Install fzf (fuzzy finder). Press ctrl+r and start typing — it searches your entire command history with fuzzy matching. Life changing.