miniguide

System Troubleshooting Cheatsheet: Essential Commands for DevOps

Introduction

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.

Table of Contents

  1. Check System Uptime
  2. Monitor CPU Usage
  3. Memory Usage
  4. Disk Space Usage
  5. Network Statistics
  6. List Processes
  7. Kill Process
  8. Check System Logs
  9. Windows Event Viewer Command
  10. System Resource Monitor

1. Check System Uptime

Linux:

uptime

Windows (PowerShell):

Get-CimInstance Win32_OperatingSystem | Select-Object LastBootUpTime

2. Monitor CPU Usage

Linux:

top

Windows (PowerShell):

Get-Counter '\Processor(_Total)\% Processor Time'

3. Memory Usage

Linux:

free -m

Windows (PowerShell):

Get-CimInstance Win32_OperatingSystem | Select-Object TotalVisibleMemorySize, FreePhysicalMemory

4. Disk Space Usage

Linux:

df -h

Windows (PowerShell):

Get-PSDrive -PSProvider FileSystem

5. Network Statistics

Linux:

netstat -tulpn

Windows (PowerShell):

Get-NetTCPConnection

6. List Processes

Linux:

ps aux

Windows (PowerShell):

Get-Process

7. Kill Process

Linux:

kill -9 <pid>

Windows (PowerShell):

Stop-Process -Id <pid> -Force

8. Check System Logs

Linux:

sudo tail -f /var/log/syslog

Windows:
Run “Event Viewer” or use Get-EventLog.

9. Windows Event Viewer Command

wevtutil qe System /c:10 /f:text

10. System Resource Monitor

Linux:

htop

Windows (PowerShell):

Get-Counter -Counter "\Memory\Available MBytes"