Terminal and shell

Check memory and CPU use

See which programs are using the most processor and memory, from the terminal.

  1. See the busiest programs, live
    Terminal
    top -o cpu

    Press q to leave.

  2. See how much memory is used
    Terminal
    top -l 1 | grep PhysMem
  1. See the busiest programs, live
    Terminal · Ubuntu / Debian
    top

    Press q to leave. Press M to sort by memory.

  2. See how much memory is used
    Terminal · Ubuntu / Debian
    free -h

    Look at the available column, not free.

  3. List the top five by CPU
    Terminal · Ubuntu / Debian
    ps aux --sort=-%cpu | head -6
  1. List the top ten by CPU
    PowerShell
    Get-Process | Sort-Object CPU -Descending | Select-Object -First 10
  2. See how much memory is free
    PowerShell
    Get-CimInstance Win32_OperatingSystem | Select-Object @{n="FreeGB";e={[math]::Round($_.FreePhysicalMemory/1MB,1)}}, @{n="TotalGB";e={[math]::Round($_.TotalVisibleMemorySize/1MB,1)}}