Skip to content

Instantly share code, notes, and snippets.

@timmyreilly
Last active August 26, 2025 17:08
Show Gist options
  • Save timmyreilly/47cf3c162eb2286094dc19642a21d043 to your computer and use it in GitHub Desktop.
Save timmyreilly/47cf3c162eb2286094dc19642a21d043 to your computer and use it in GitHub Desktop.
# Unix
echo "=== Quick System Check ===" && top -bn1 | grep "Cpu" | awk '{print "CPU Used: " 100-$8 "%"}' && free -h | grep "Mem" | awk '{print "Memory: " $3 "/" $2 " (" int($3/$2*100) "%)"}' && echo "Load: $(uptime | awk -F'load average:' '{print $2}')"
# Windows Powershell
$cpu = (Get-CimInstance Win32_Processor | Measure-Object LoadPercentage -Average).Average; $mem = Get-CimInstance Win32_OperatingSystem; $memPct = [math]::Round(($mem.TotalVisibleMemorySize - $mem.FreePhysicalMemory) / $mem.TotalVisibleMemorySize * 100, 1); Write-Host "CPU: $cpu% | Mem: $memPct% | Uptime: $((Get-Date) - $mem.LastBootUpTime | ForEach-Object {"$($_.Days)d $($_.Hours)h"})" -ForegroundColor Cyan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment