Linux commands

The commands I reach for most when troubleshooting. Filter by category, click copy.

CommandWhat for
ip -br aInterfaces and IPs, short format
ss -tulpnListening ports and the process behind them
mtr -rwc 50 8.8.8.8Traceroute + packet loss per hop
dig +short example.comQuick DNS lookup
curl -sv -o /dev/null https://example.comTLS handshake and HTTP headers
tcpdump -ni eth0 port 443Capture traffic on a port
htopLive CPU, memory and processes
df -hDisk usage per filesystem
free -hMemory usage
systemctl status nginxStatus of a service
journalctl -u nginx -fFollow a service's logs
tail -f /var/log/syslogFollow the system log
grep -i error /var/log/syslogFind errors in a log
find / -name '*.conf' 2>/dev/nullFind files by name
chmod 600 key.pemLock down an SSH key
rsync -avz src/ user@host:/dst/Sync folders over SSH