Skip to content
shellmap

get-processPowerShell's process-listing cmdlet — the ps equivalent across all 5 shells

Equivalents in every shell

Bashunix
ps -ef

POSIX `ps` lists processes as TEXT — column shape varies by `-o` format string. `ps -eo pid,user,comm,args,%cpu` is a common scriptable form; `ps -ef` is the classic System V style; `ps aux` is BSD-style. Output is one line per process — downstream parsing uses `awk`, `sort`, `grep`.

Zshunix
ps -ef

Same external `/bin/ps`. macOS `ps` is BSD-derived — `ps aux` and `ps -ef` both work; `ps -eo` accepts different column names than Linux (`stime` vs `start_time`). Cross-platform scripts should constrain to `pid`, `user`, `comm`, `args`, `pcpu`, `pmem` — the intersection.

Fishunix
ps -ef

Same external. Fish has no built-in process inspector. For just-this-shell's child processes use `jobs` (fish-builtin) — NOT the same as full `ps`; `jobs` only sees backgrounded jobs of the current shell.

PowerShellwindows
Get-Process

PowerShell-native cmdlet (aliases `gps`, `ps`). Returns `[System.Diagnostics.Process]` OBJECTS — `.WorkingSet64`, `.CPU`, `.Path`, `.StartTime`, `.MainModule.FileVersionInfo` are direct property reads. `-Name` and `-Id` filter at the cmdlet level; `-IncludeUserName` adds the owner column but requires elevation.

cmd.exewindows
tasklist

Built-in process snapshot. `tasklist /v` adds the window title and user; `/svc` lists services per process; `/fi "imagename eq node.exe"` filters by name. Output is fixed-width text — no object piping. For PID-by-port, cross-reference `netstat -ano` output.

Worked examples

List all running processes

Bash
ps -ef
PowerShell
Get-Process
cmd.exe
tasklist

Find the top 10 CPU-consuming processes

Bash
ps aux --sort=-%cpu | head -11
PowerShell
Get-Process | Sort-Object CPU -Descending | Select-Object -First 10 Name, Id, CPU
cmd.exe
tasklist /v /fo csv | sort

Find a process by name (wildcard)

Bash
pgrep -fl nginx
PowerShell
Get-Process -Name nginx*
cmd.exe
tasklist /fi "imagename eq nginx.exe"

Gotchas

  • `Get-Process`'s `.CPU` property is TOTAL CPU-SECONDS since the process started, NOT a live percentage. For a percent-over-window reading, sample twice with `Start-Sleep` and divide deltas, or use `Get-Counter '\Process(*)\% Processor Time'`. This is the most common surprise for `top` / `htop` muscle memory.
  • `Get-Process -IncludeUserName` requires an ELEVATED PowerShell session — without admin, the UserName column is BLANK for everyone but the calling user, and no error is raised. Linux `ps -eo user,comm` shows owners without elevation; cross-platform scripts that filter by user need an `if (-not (IsAdmin)) { throw ... }` guard on the Windows path.
  • Reading `.Path` or `.MainModule` for processes you don't own throws `Access denied` even as admin if the process is a PROTECTED one (System, services running as TrustedInstaller, antivirus). Wrap with `try { $_.Path } catch { '<protected>' }` when iterating over `Get-Process`.
  • `(Get-Process -Id $pid).WaitForExit()` BLOCKS the entire pipeline indefinitely. To wait non-blockingly use the cmdlet `Wait-Process -Id <pid> -Timeout <sec>` — cancellable, returns a clear timeout error, integrates with `try/catch`. The `.WaitForExit()` method is fine in one-shot scripts but disastrous in PowerShell pipelines.
  • The PowerShell alias `ps` for `Get-Process` collides with the Unix binary on pwsh Linux/macOS — `ps` resolves to the cmdlet FIRST. To call the real Unix `ps`, use the full path (`/bin/ps aux`) or remove the alias for the session (`Remove-Alias ps`). Scripts that target Unix pwsh should spell `Get-Process` (or `/bin/ps`) explicitly.

WSL & PowerShell Core notes

pwsh`Get-Process` is available on every PowerShell platform. On Linux/macOS pwsh the object shape is a partial subset of Windows — `.UserName`, `.Path`, `.Modules` work; Windows-specific fields (`.MainWindowTitle`, `.Description`) are `$null`. Cross-platform code should test fields against `$null` rather than relying on a fixed shape.
WSLFrom PowerShell, `Get-Process` lists Windows processes ONLY. To see WSL Linux processes, invoke `wsl ps -ef` through interop. From inside WSL, `ps` only lists Linux processes; to inspect Windows-side processes call `tasklist.exe` or `pwsh.exe -c 'Get-Process'`. PIDs are not shared between the two worlds.

Common tasks using get-process

Related commands