All articles
InfrastructureJanuary 20, 20266 min read

Linux Commands Every Backend Developer Should Know

A focused reference of the Linux commands I reach for most when working on backend systems — process management, logs, file transfer, and server hardening.

LinuxBashDevOpsServerBackend

As a backend developer who deploys and maintains production servers, a small set of Linux commands covers most of what I need daily.

Process and port management

# Find what process is using a port
lsof -i :3001
ss -tulpn | grep 3001

# Kill a process by PID
kill -9 <pid>

# Interactive process viewer
htop

Logs

# Follow a log file in real time
tail -f /var/log/nginx/access.log

# Last 100 lines from systemd service
journalctl -u nginx -n 100 --no-pager

# PM2 logs
pm2 logs myapp-api --lines 100

File transfer

# Transfer files, skip node_modules
rsync -avz --progress --exclude node_modules \
  ./dist user@server:/var/www/myapp/

# Fix ownership after transfer
chown -R www-data:www-data /var/www/myapp

Network diagnostics

# Check active firewall rules
ufw status verbose

# DNS lookup
dig api.example.com

# Trace route
traceroute api.example.com

Server hardening checklist

  • Disable root SSH login: set PermitRootLogin no in /etc/ssh/sshd_config
  • Use key-based auth only: set PasswordAuthentication no
  • Configure UFW: allow 22, 80, 443 then enable
  • Install fail2ban for brute-force protection
NOTE

Add useful aliases to ~/.bashrc: alias ll='ls -lah', alias gs='git status'. Small habits compound significantly on a server you SSH into every day.