DEV Community

7 Terminal Commands That Senior Developers Use Daily (But Juniors Never Learn)

I watched a senior developer debug a production issue in 3 minutes.

It would have taken me an hour.

The difference? They lived in the terminal. Here are 7 commands that changed my workflow.

1. git log --oneline --graph --all

Forget GUI git clients. This one command shows you:

  • All branches visually
  • Commit history at a glance
  • Where branches diverge and merge
# Even better, alias it:
alias gl="git log --oneline --graph --all --decorate"
Enter fullscreen mode Exit fullscreen mode

2. curl -s URL | jq .

Test APIs without Postman:

curl -s https://api.github.com/users/octocat | jq '.name, .bio'
Enter fullscreen mode Exit fullscreen mode

jq is a game-changer for working with JSON. Learn it once, use it forever.

3. find . -name "*.log" -mtime +7 -delete

Find and delete files older than 7 days:

# Find large files
find . -size +100M -type f

# Find recently modified files
find . -mmin -30 -type f
Enter fullscreen mode Exit fullscreen mode

4. watch -n 5 command

Run any command every N seconds:

# Monitor disk space
watch -n 5 df -h

# Watch pod status
watch -n 2 kubectl get pods

# Monitor log file
watch -n 1 "tail -5 app.log"
Enter fullscreen mode Exit fullscreen mode

5. history | awk '{print $2}' | sort | uniq -c | sort -rn | head -10

See your 10 most-used commands:

# My top 3:
# 287 git
# 203 cd
# 156 python
Enter fullscreen mode Exit fullscreen mode

If you type something 100+ times, alias it.

6. xargs (The Multiplier)

Run a command on multiple inputs:

# Delete all .pyc files
find . -name "*.pyc" | xargs rm

# Run tests on changed files only
git diff --name-only | grep test | xargs pytest

# Kill all node processes
ps aux | grep node | awk '{print $2}' | xargs kill
Enter fullscreen mode Exit fullscreen mode

7. && and || (Flow Control)

# Run next command only if previous succeeds
npm test && npm run build && npm run deploy

# Run fallback if command fails
git pull || echo "Pull failed, check your connection"

# Combined
make build && echo "Success!" || echo "Build failed"
Enter fullscreen mode Exit fullscreen mode

Simple but powerful. Chain operations with confidence.

Bonus: Create a .aliases File

# ~/.aliases
alias gs="git status"
alias gp="git push"
alias dc="docker compose"
alias py="python3"
alias serve="python3 -m http.server 8000"
alias ports="lsof -i -P -n | grep LISTEN"
Enter fullscreen mode Exit fullscreen mode

The Mindset Shift

Juniors use GUIs for everything.
Seniors automate with the terminal.

It's not about memorizing commands. It's about recognizing patterns:

  • "I do this manually every day" → automate it
  • "I click through 5 menus for this" → one command
  • "This takes me 10 minutes" → script it down to 10 seconds

What's your most-used terminal command? Share it in the comments!

I share developer productivity tips on Telegram.

Top comments (0)