Rafian.com Direct

Let me know on Twitter/X @rafian (or in the comments below). Enjoyed this? Bookmark rafian.com for more practical dev and productivity posts every Tuesday.

5 Terminal Tricks That Save Me 2 Hours Every Week (Linux/macOS) rafian.com

function killport() awk 'NR!=1 print $2' Now run: killport 3000 → It kills everything on port 3000 instantly. No more hunting for PIDs. grep is slow on large codebases. Use rg (ripgrep) instead. It respects .gitignore and is 10x faster. Let me know on Twitter/X @rafian (or in the comments below)

alias rm='trash' Deleted files go to your system Trash. You can restore them. This has saved my career at least twice. Pressing the up arrow 20 times is for beginners. Instead, type a partial command and press Ctrl+R . 5 Terminal Tricks That Save Me 2 Hours

Pro tip: I bound this to Ctrl+F in my terminal. Search your entire project in under 1 second. You deleted a file with rm ? On most systems, it’s gone forever. Not anymore.

/terminal-productivity-hacks