HxHippy

SysAdmin Daily Cheat Sheet

Essential daily commands and workflows for system administrators.

Last updated: 2025-01-15

SysAdmin Daily Cheat Sheet

Essential commands and workflows for daily system administration tasks.

Quick Reference

# System status at a glance
uptime && free -h && df -h

# What's using resources
top -bn1 | head -20

# Recent system events
journalctl -p err --since "1 hour ago"

System Health

CPU & Memory

# CPU info
lscpu | grep -E "^CPU|^Model|^Thread"
cat /proc/loadavg

# Memory usage
free -h
vmstat 1 5

# Top processes by CPU
ps aux --sort=-%cpu | head -10

# Top processes by memory
ps aux --sort=-%mem | head -10

Disk Usage

# Filesystem usage
df -h
df -i  # Inodes

# Directory sizes
du -sh /var/log/*
du -sh /* 2>/dev/null | sort -h

# Find large files
find / -type f -size +100M -exec ls -lh {} \; 2>/dev/null

# Disk I/O
iostat -x 1 5

Service Management

# Service status
systemctl status nginx
systemctl is-active nginx
systemctl is-enabled nginx

# Start/stop/restart
systemctl start nginx
systemctl stop nginx
systemctl restart nginx
systemctl reload nginx

# Enable/disable at boot
systemctl enable nginx
systemctl disable nginx

# List failed services
systemctl --failed

# View service logs
journalctl -u nginx -f
journalctl -u nginx --since "1 hour ago"

User Management

# List users
cat /etc/passwd | cut -d: -f1
getent passwd

# User info
id username
groups username
last username

# Add user
useradd -m -s /bin/bash username
passwd username

# Add to sudo
usermod -aG sudo username

# Currently logged in
who
w

Log Analysis

# System logs
tail -f /var/log/syslog
journalctl -f

# Auth logs
tail -f /var/log/auth.log
grep "Failed password" /var/log/auth.log | tail -20

# Application logs
tail -f /var/log/nginx/error.log

# Search logs
grep -i error /var/log/syslog | tail -50
journalctl -p err --since today

Network Diagnostics

# Connections
ss -tuln
netstat -tuln
lsof -i :80

# Network info
ip addr
ip route
cat /etc/resolv.conf

# Test connectivity
ping -c 4 8.8.8.8
curl -I https://example.com
nc -zv hostname 443

Backup Verification

# Check backup timestamps
ls -la /backup/
find /backup -mtime -1 -type f

# Verify backup integrity
md5sum /backup/latest.tar.gz
tar -tzf /backup/latest.tar.gz | head

# Backup space
df -h /backup

Common Troubleshooting

Symptom Quick Check
Slow system top, iostat, free -h
Disk full df -h, du -sh /*
Service down systemctl status, journalctl -u
Can't connect ss -tuln, ping, curl
High load uptime, ps aux --sort=-%cpu

Daily Checklist

  • Check system load and uptime
  • Review failed services
  • Check disk usage (< 80%)
  • Review error logs
  • Verify backups completed
  • Check security alerts
intermediate DevOps Roles Updated 2025-01-15
  • sysadmin
  • linux
  • system administration
  • commands
  • daily tasks