System Monitoring
System performance monitoring and troubleshooting commands
System Resource Monitoring
System resource monitoring and performance analysis
# Show system load
uptime
# Show system information
uname -a
# Show CPU information
cat /proc/cpuinfo
# Show memory information
cat /proc/meminfo
# Show disk usage
df -h
# Show disk usage by directory
du -h /path
# Show largest directories
du -h | sort -hr | head -10
# Show inode usage
df -i
# Show filesystem type
df -T
# Show memory usage
free -h
# Show memory usage continuously
free -h -s 5
# Show CPU usage
top
# Show CPU usage with 1 second interval
top -d 1
# Show I/O statistics
iostat -x 1
# Show network statistics
netstat -i
# Show system load average
cat /proc/loadavg
# Show system uptime
cat /proc/uptime
Individual commands:
uptime
uname -a
cat /proc/cpuinfo
cat /proc/meminfo
df -h
du -h /path
du -h | sort -hr | head -10
df -i
df -T
free -h
free -h -s 5
top
top -d 1
iostat -x 1
netstat -i
cat /proc/loadavg
cat /proc/uptime
Log Management
System log viewing and management with journalctl
# Show system logs
journalctl
# Show logs with follow
journalctl -f
# Show logs since boot
journalctl -b
# Show logs for specific service
journalctl -u service_name
# Show logs with priority
journalctl -p err
# Show logs with time range
journalctl --since "2024-01-01" --until "2024-01-02"
# Show kernel logs
journalctl -k
# Show boot logs
journalctl -b
# Show logs with specific unit
journalctl -u nginx.service
# Show logs with reverse order
journalctl -r
# Show logs with no pager
journalctl --no-pager
# Show logs with JSON output
journalctl -o json
# Show logs with verbose output
journalctl -o verbose
# Clear journal logs
sudo journalctl --vacuum-time=7d
# Show log disk usage
journalctl --disk-usage
Individual commands:
journalctl
journalctl -f
journalctl -b
journalctl -u service_name
journalctl -p err
journalctl --since "2024-01-01" --until "2024-01-02"
journalctl -k
journalctl -b
journalctl -u nginx.service
journalctl -r
journalctl --no-pager
journalctl -o json
journalctl -o verbose
sudo journalctl --vacuum-time=7d
journalctl --disk-usage
System Troubleshooting
System troubleshooting and diagnostic commands
# Check system errors
dmesg | grep -i error
# Check system warnings
dmesg | grep -i warning
# Show kernel messages
dmesg
# Show recent kernel messages
dmesg | tail -20
# Check hardware errors
dmesg | grep -i "hardware error"
# Check memory errors
dmesg | grep -i "memory error"
# Check disk errors
dmesg | grep -i "disk error"
# Check network errors
dmesg | grep -i "network"
# Show system call trace
strace -p 1234
# Show system call trace for command
strace command_name
# Show network connections
ss -tulpn
# Show network statistics
cat /proc/net/dev
# Check system limits
ulimit -a
# Check file descriptor limits
lsof | wc -l
# Check system load
cat /proc/loadavg
# Check system temperature (if available)
sensors
# Check system power status
cat /sys/class/power_supply/BAT0/status
Individual commands:
dmesg | grep -i error
dmesg | grep -i warning
dmesg
dmesg | tail -20
dmesg | grep -i "hardware error"
dmesg | grep -i "memory error"
dmesg | grep -i "disk error"
dmesg | grep -i "network"
strace -p 1234
strace command_name
ss -tulpn
cat /proc/net/dev
ulimit -a
lsof | wc -l
cat /proc/loadavg
sensors
cat /sys/class/power_supply/BAT0/status