Not found locally for pidstat. Try Google search
pidstat - Report statistics for Linux tasks.
| Use Case | Command | Description |
|---|---|---|
| ๐ Monitor CPU usage of all active tasks every 2 seconds, 5 reports | pidstat 2 5 | Display five reports of CPU statistics for every active task at 2-second intervals. |
| ๐ฅ๏ธ Memory & page faults for a specific PID | pidstat -r -p 1643 2 5 | Display five reports of page faults and memory statistics for PID 1643. |
| ๐ Filter processes by name pattern | pidstat -C "fox|bird" -r -p ALL | Display global page faults and memory statistics for processes with command name containing "fox" or "bird". |
| ๐ถ Monitor child processes of all tasks | pidstat -T CHILD -r 2 5 | Display five reports of page faults statistics for child processes of all tasks. |
| โก Real-time continuous monitoring | pidstat -p ALL 1 | Continuously report statistics for all tasks every second. |
| ๐ I/O statistics | pidstat -d | Report I/O statistics (disk read/write per second). |
| ๐ Context switching | pidstat -w | Report voluntary and involuntary context switches per second. |
| ๐ข Stack utilization | pidstat -s | Report stack size and referenced stack memory. |
pidstat [ -d ] [ -H ] [ -h ] [ -I ] [ -l ] [ -R ] [ -r ] [ -s ] [ -t ]
[ -U [ username ] ] [ -u ] [ -V ] [ -v ] [ -w ] [ -C comm ] [ -G
process_name ] [ --dec={ 0 | 1 | 2 } ] [ --human ] [ -p { pid[,...] |
SELF | ALL } ] [ -T { TASK | CHILD | ALL } ] [ interval [ count ] ] [
-e program args ]
The pidstat command is used for monitoring individual tasks currently being managed by the Linux kernel. It writes to standard output activities for every task selected with option -p or for every task managed by the Linux kernel if option -p ALL has been used. Not selecting any tasks is equivalent to specifying -p ALL but only active tasks (tasks with non-zero statistics values) will appear in the report.
The pidstat command can also be used for monitoring the child processes of selected tasks. Read about option -T below.
The interval parameter specifies the amount of time in seconds between each report. A value of 0 (or no parameters at all) indicates that tasks statistics are to be reported for the time since system startup (boot). The count parameter can be specified in conjunction with the interval parameter if this one is not set to zero. The value of count determines the number of reports generated at interval seconds apart. If the interval parameter is specified without the count parameter, the pidstat command generates reports continuously.
You can select information about specific task activities using flags. Not specifying any flags selects only CPU activity.
-C commDisplay only tasks whose command name includes the string comm. This string can be a regular expression.
-d โ Report I/O statisticsKernels 2.6.20 and later only. The following values may be displayed:
--dec={ 0 | 1 | 2 }Specify the number of decimal places to use (0 to 2, default is 2).
-e program argsExecute program with given arguments args and monitor it with pidstat. pidstat stops when program terminates.
-G process_nameDisplay only processes whose command name includes the string process_name. This string can be a regular expression. If option -t is used together with -G, then the threads belonging to that process are also displayed (even if their command name doesn't include the string).
-HDisplay timestamp in seconds since the epoch.
-hDisplay all activities horizontally on a single line, with no average statistics at the end. Intended for easier parsing by other programs.
--humanPrint sizes in human readable format (e.g., 1.0k, 1.2M, etc.). Units supersede any other default units (e.g., kilobytes, sectors).
-IIn an SMP environment, indicate that tasks CPU usage (as displayed by option -u) should be divided by the total number of processors.
-lDisplay the process command name and all its arguments.
-p { pid[,...] | SELF | ALL }Select tasks (processes) for which statistics are to be reported. pid is the process identification number. SELF indicates statistics for the pidstat process itself. ALL indicates statistics for all tasks managed by the system.
-R โ Report realtime priority and scheduling policyThe following values may be displayed:
-r โ Report page faults and memory utilizationWhen reporting statistics for individual tasks, the following values may be displayed:
When reporting global statistics for tasks and all their children, the following values may be displayed:
-s โ Report stack utilizationThe following values may be displayed:
-T { TASK | CHILD | ALL }Specifies what to monitor. TASK (default) reports statistics for individual tasks. CHILD reports globally for selected tasks and all their children. ALL reports both individual and global statistics. Note: Global statistics for children are collected only when a child finishes or is killed.
-t โ Also display statistics for threadsAdds the following values to reports:
-U [ username ]Display the real user name of the tasks instead of the UID. If username is specified, only tasks belonging to that user are displayed.
-u โ Report CPU utilizationWhen reporting for individual tasks:
-I is used.When reporting global statistics for tasks and children:
-VPrint version number then exit.
-v โ Report values of some kernel tablesThe following values may be displayed:
-w โ Report task switching activityKernels 2.6.23 and later only. The following values may be displayed:
The pidstat command takes into account the following environment variables:
S_COLORSBy default statistics are displayed in color when output is connected to a terminal. Use this variable to change settings. Possible values: never, always, or auto (default). Note: The color used is not indicative of any issue; it only indicates different ranges of values.
S_COLORS_SGRSpecify colors and other attributes for terminal display. Value is a colon-separated list of capabilities, defaulting to H=31;1:I=32;22:M=35;1:N=34;1:Z=34;22. Supported capabilities:
S_TIME_FORMATIf this variable exists and its value is ISO, the current locale will be ignored when printing the date in the report header. The pidstat command will use ISO 8601 format (YYYY-MM-DD) instead. The timestamp will also be compliant with ISO 8601 format.
pidstat 2 5
Display five reports of CPU statistics for every active task in the system at two second intervals.
pidstat -r -p 1643 2 5
Display five reports of page faults and memory statistics for PID 1643 at two second intervals.
pidstat -C "fox|bird" -r -p ALL
Display global page faults and memory statistics for all processes whose command name includes the string "fox" or "bird".
pidstat -T CHILD -r 2 5
Display five reports of page faults statistics at two second intervals for the child processes of all tasks in the system. Only child processes with non-zero statistics values are displayed.
/proc filesystem must be mounted for the pidstat command to work.
Although pidstat speaks of kilobytes (kB), megabytes (MB)..., it actually uses kibibytes (kiB), mebibytes (MiB)... A kibibyte is equal to 1024 bytes, and a mebibyte is equal to 1024 kibibytes.
/proc contains various files with system statistics.
Sebastien Godard (sysstat <at> orange.fr)
sar(1), top(1), ps(1), mpstat(1), iostat(1), vmstat(8)
https://github.com/sysstat/sysstat
http://pagesperso-orange.fr/sebastien.godard/
Generated by phpman v4.10.0-7-g98e9fd5 Author: Che Dong Under GNU General Public License
2026-09-10 21:02 @2600:1f28:365:80b0:2634:f534:c836:dc5e
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)