Bash Powershell CPU Usage Display

Displaying CPU Usage from Command Line in Bash or PowerShell

This article introduces how to display CPU usage from the command line such as Linux's WSL Bash, Windows' cmd.exe, and PowerShell.

Shou Arisaka
1 min read
Nov 1, 2025

This article introduces how to display CPU usage from the command line such as Linux’s WSL Bash, Windows’ cmd.exe, and PowerShell.

Image

For Bash:

grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage "%"}'

bash - How to get overall CPU usage (e.g. 57%) on Linux - Stack Overflow

For PowerShell:

$( Get-WmiObject win32_processor | Measure-Object -property LoadPercentage -Average | Select Average ).Average

How do I find the CPU and RAM usage using PowerShell? - Stack Overflow

For reference if you want to do it in C#:

get cpu usage site:stackoverflow.com - Google Search

Share this article

Shou Arisaka Nov 1, 2025

🔗 Copy Links