Forrest logo
back to the prstat tool

prstat:tldr:cf4f8

prstat: Examine all processes and reports statistics sorted by CPU usage.
$ prstat
try on your machine

The "prstat" command is a Unix command used to monitor process-level information in real-time. It provides statistics about system resources (CPU, memory, and I/O) usage, as well as information about individual processes running on the system.

When you execute the "prstat" command in a terminal, it displays a table with various columns indicating different resource usage metrics for each process. Some common columns include:

  • PID: The process ID number assigned to each running process.
  • USERNAME: The user account that owns the process.
  • SIZE: The virtual size (memory) of the process.
  • RSS: The resident set size (memory) of the process.
  • CPU: The percentage of CPU utilization by the process.
  • PRI: The priority of the process in the system.
  • STATE: The current state of the process (running, sleeping, etc.).
  • TIME: The accumulated CPU time used by the process.

By default, the "prstat" command updates the statistics every second and displays them in real-time. It also provides options to customize the output by specifying a different sampling interval, sorting the output based on certain fields, or limiting the number of processes displayed.

The "prstat" command is particularly useful for system administrators and developers to identify processes that consume excessive resources, investigate performance issues, or monitor the overall health of the system.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the prstat tool