DEV Community

James Miller
James Miller

Posted on

10 Terminal Power Moves That Make Your Teammates Say “Wait, HOW Did You Do That?”

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
Enter fullscreen mode Exit fullscreen mode

Top 10 processes by CPU usage

ps aux --sort=-%cpu | head -n 11
Enter fullscreen mode Exit fullscreen mode

Top 10 processes by memory usage

ps aux --sort=-%mem | head -n 11
Enter fullscreen mode Exit fullscreen mode

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
}
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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"}'
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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/
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Find all .tsx files

fd ".tsx$"
Enter fullscreen mode Exit fullscreen mode

Find and delete all .log files

fd ".log$" --exec rm {}
Enter fullscreen mode Exit fullscreen mode

Bulk rename without obscure tools:

Turn all .jpeg files into .jpg

for img in *.jpeg; do
mv "$img" "${img%.jpeg}.jpg"
done

Enter fullscreen mode Exit fullscreen mode

7. History Superpowers: !! and !\$

Two tiny expansions that feel like cheating:

You try this:

mkdir /usr/local/my-app
Enter fullscreen mode Exit fullscreen mode

Permission denied...
Instead of retyping:

sudo !!

Expands to: sudo mkdir /usr/local/my-app
Enter fullscreen mode Exit fullscreen mode

And:

Deeply nested directory

mkdir -p projects/a-very-long/and-nested/project-name
Enter fullscreen mode Exit fullscreen mode

Jump into it

cd !$
Enter fullscreen mode Exit fullscreen mode

→ cd projects/a-very-long/and-nested/project-name
Create a file inside it

touch !$/index.js
Enter fullscreen mode Exit fullscreen mode

!! = 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"
Enter fullscreen mode Exit fullscreen mode

Politely ask all matching Python scripts to exit

pkill -f "python.*.py"

Enter fullscreen mode Exit fullscreen mode

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"
}
Enter fullscreen mode Exit fullscreen mode

Example:

free_port 8000
Enter fullscreen mode Exit fullscreen mode

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)"

Enter fullscreen mode Exit fullscreen mode

Clean up merged branches in one shot:

git branch --merged main | grep -v "*|main|develop" | xargs -n 1 git branch -d
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Pretty-print JSON from clipboard (macOS)

pbpaste | jq .
Enter fullscreen mode Exit fullscreen mode

Extract selected fields from an API response

curl -s 'https://api.github.com/users/torvalds' | jq '.name, .followers'

Enter fullscreen mode Exit fullscreen mode

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 .
}
Enter fullscreen mode Exit fullscreen mode

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"
}

Enter fullscreen mode Exit fullscreen mode

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)

Collapse
 
pauldmurphy profile image
Paul Murphy

Some of these are genuinely useful. Thank you!