Even in the age of powerful IDEs, developers still live in the terminal. After a few years, everyone collects a bag of tricks—some painful lessons, some tiny optimizations—that quietly 2x your speed.
This article skips the ls -la basics and goes straight to battle-tested commands and habits that genuinely changed my workflow (and made nearby teammates lean over and say: “You did what with just one command?”).
1. Find Performance Bottlenecks in Seconds
When your server or laptop suddenly feels like it’s running in molasses, you need quick visibility: who’s hogging disk, CPU, or RAM?
Top 10 space hogs in the current directory (one level deep)
du -ah --max-depth=1 | sort -rh | head -n 10
Top 10 processes by CPU usage
ps aux --sort=-%cpu | head -n 11
Top 10 processes by memory usage
ps aux --sort=-%mem | head -n 11
This trio gives you a fast “X-ray” of your system without opening a heavy GUI.
2. Let a Local Dev Environment Platform Handle the Mess
Old-school environment management usually means a graveyard of shell functions and exported variables:
Old way: manually switching project environments
switch_env() {
if [ "$1" = "proj_a" ]; then
export DB_HOST="localhost"
export DB_PORT="3306"
echo "Switched to Project A"
elif [ "$1" = "proj_b" ]; then
export DB_HOST="127.0.0.1"
export DB_PORT="5432"
echo "Switched to Project B"
fi
}
This works—until you have 8+ projects, multiple PHP/Node/Python/Go versions, and different databases per app. The config files bloat, mistakes creep in, and “works on my machine” bugs multiply.
A modern local dev environment platform like ServBay centralizes all of this:
- One UI to choose PHP, Node.js, Python, Go, Rust versions per project.
- MySQL/PostgreSQL/Redis/MongoDB ready to run without editing config files.
- Profiles per project instead of ad-hoc shell scripts.
You stop writing brittle glue code and just pick versions, services, and ports from a clean dashboard.
Even better, platforms like ServBay can install AI with a click, wiring Ollama and popular open LLMs (Llama, Qwen, DeepSeek, etc.) into your local stack without manual setup. That turns your machine into a full AI playground with zero Docker-YAML-devops headaches.
3. One-Liner Network Debugging
You don’t always need Postman or a GUI client to test connectivity.
Check if port 3306 is open locally
nc -zv 127.0.0.1 3306
Quick POST request to an API
curl -X POST http://localhost:8080/api/v1/users
-H "Content-Type: application/json"
-d '{"username":"test","role":"admin"}'
Perfect for quick checks in CI, containers, or remote servers.
4. Teleport Between Directories with pushd/popd
Still chaining cd ../../.. like it’s 2005? Directory stacks are your new best friend:
From /Users/me/workspace/project-a/src
pushd /etc/nginx/conf.d
You’re now in Nginx config, and the shell remembers where you came from
Edit configs...
vim default.conf
Jump right back
popd
Back at /Users/me/workspace/project-a/src
Use dirs -v to inspect the stack, and pushd +N to jump between multiple saved locations. This is life-changing when you constantly bounce between logs, configs, and project roots.
5. Copy Files with Progress (and Confidence)
Plain cp gives you zero feedback for huge files. rsync is better:
Copy a large file with a progress bar
rsync -avh --progress source-large-file.zip /path/to/destination/
You get speed, resumability, and visibility in one command.
6. Smarter File Search and Bulk Rename
find is powerful but verbose. fd is a friendlier alternative:
Install fd (examples)
brew install fd # macOS
apt install fd-find # Debian/Ubuntu
Find all .tsx files
fd ".tsx$"
Find and delete all .log files
fd ".log$" --exec rm {}
Bulk rename without obscure tools:
Turn all .jpeg files into .jpg
for img in *.jpeg; do
mv "$img" "${img%.jpeg}.jpg"
done
7. History Superpowers: !! and !\$
Two tiny expansions that feel like cheating:
You try this:
mkdir /usr/local/my-app
Permission denied...
Instead of retyping:
sudo !!
Expands to: sudo mkdir /usr/local/my-app
And:
Deeply nested directory
mkdir -p projects/a-very-long/and-nested/project-name
Jump into it
cd !$
→ cd projects/a-very-long/and-nested/project-name
Create a file inside it
touch !$/index.js
!! = last command; !$ = last argument of last command. Once this becomes muscle memory, your arrow keys get a well-deserved break.
8. Saner Process and Port Management
No more ps aux | grep ... | awk ... | kill ... gymnastics every time.
Kill processes by name
pkill -f "gunicorn"
Politely ask all matching Python scripts to exit
pkill -f "python.*.py"
Freeing stubborn ports? Add this to your ~/.zshrc or ~/.bashrc:
free_port() {
lsof -i tcp:$1 | grep LISTEN | awk '{print $2}' | xargs kill -9
echo "Port $1 freed"
}
Example:
free_port 8000
Run free_port 8000 and move on with your life.
9. Git Aliases That Feel Like Built-Ins
In ~/.gitconfig:
[alias]
co = checkout
br = branch
ci = commit -m
st = status -sb
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
unstage = reset HEAD --
undo = reset --soft HEAD~1
pushup = "!git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)"
Clean up merged branches in one shot:
git branch --merged main | grep -v "*|main|develop" | xargs -n 1 git branch -d
Your branch list will finally stop looking like a junk drawer.
10. Processing: Logs, JSON, and APIs
A few patterns you’ll use every day:
Extract all URLs from a log file
grep -oE 'https?://[a-zA-Z0-9./-]+' access.log
Pretty-print JSON from clipboard (macOS)
pbpaste | jq .
Extract selected fields from an API response
curl -s 'https://api.github.com/users/torvalds' | jq '.name, .followers'
Once jq becomes part of your toolbox, you’ll never want to parse JSON by hand again.
Bonus: Turn Repetition into One-Word Commands
The real productivity unlock isn’t a single command, but capturing repeated workflows in functions or scripts.
Initialize a new React project end-to-end
new_react_project() {
npx create-react-app "$1" && cd "$1"
git init && git add .
git commit -m "🎉 Initial commit"
code .
}
Quick backup of the current directory (respecting .gitignore)
backup() {
local fname="backup-$(date +%Y%m%d-%H%M).tar.gz"
tar -czvf "$fname" . --exclude-from=.gitignore
echo "Backup created: $fname"
}
Drop these into your shell config; the next time you spin up a project or prepare for a risky refactor, it’s just one command.
Final Thoughts
None of these tricks are flashy on their own. But once they become muscle memory, your terminal stops feeling like a bottleneck and starts feeling like a superpower.
Combine that with a solid local dev environment platform that can install AI with a click, and you’ll spend far less time fighting tools—and far more time shipping things your teammates actually say “whoa” about.


Top comments (1)
Some of these are genuinely useful. Thank you!