Real Production One-Liners

These are short commands that solve common production tasks fast. They are especially useful for support engineers, backend developers and operators.

One-Liners

# Top 10 biggest files under current directory
find . -type f -printf '%s %p\n' | sort -nr | head -10

# Show processes using most memory
ps aux --sort=-%mem | head

# Show processes using most CPU
ps aux --sort=-%cpu | head

# Count unique errors
grep ERROR app.log | sort | uniq -c | sort -nr | head

# Find all jars
find /opt -type f -name '*.jar'

# Find which process owns port 8080
lsof -i :8080

# Tail logs and show only serious lines
tail -f app.log | grep -E 'ERROR|WARN|Exception'

# Show files modified today
find . -type f -mtime -1

# Show directories by size
du -sh * | sort -h

# Validate HTTP health endpoint
curl -fsS http://localhost:8080/actuator/health

# Search in gz logs
zgrep -n 'timeout' *.gz

# Check disk usage >80%
df -h | awk 'NR==1 || $5+0 > 80'

# Kill stuck spring process
pkill -f spring

# Show recent history for investigation
history | tail -50

# Compare two config files side by side
vimdiff app.yml app-prod.yml

Tip

Save your favorite one-liners into a personal shell file or internal wiki. A good engineer builds a reusable command toolkit instead of searching from zero every time.