This cheatsheet offers a set of commonly used system troubleshooting commands. It covers commands for monitoring system performance, checking resource usage, and diagnosing issues on both Linux and Windows systems.
Linux:
uptime
Windows (PowerShell):
Get-CimInstance Win32_OperatingSystem | Select-Object LastBootUpTime
Linux:
top
Windows (PowerShell):
Get-Counter '\Processor(_Total)\% Processor Time'
Linux:
free -m
Windows (PowerShell):
Get-CimInstance Win32_OperatingSystem | Select-Object TotalVisibleMemorySize, FreePhysicalMemory
Linux:
df -h
Windows (PowerShell):
Get-PSDrive -PSProvider FileSystem
Linux:
netstat -tulpn
Windows (PowerShell):
Get-NetTCPConnection
Linux:
ps aux
Windows (PowerShell):
Get-Process
Linux:
kill -9 <pid>
Windows (PowerShell):
Stop-Process -Id <pid> -Force
Linux:
sudo tail -f /var/log/syslog
Windows:
Run “Event Viewer” or use Get-EventLog
.
wevtutil qe System /c:10 /f:text
Linux:
htop
Windows (PowerShell):
Get-Counter -Counter "\Memory\Available MBytes"