Sample per-process disk I/O and rank active writers
Build a paste-ready command, then review its compatibility and effects before running it.
pidstat -d <seconds> <count> | awk '$4 ~ /^[0-9]+$/ {print}' | sort -k6,6nr | head -<lines>Complete required fields to copy the generated command.
read-onlyno known side effects Compatibility
LinuxVerified for Linux using bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementspidstatpidstat must be installed and available on PATH.
Version supportpidstat Current supported releasesVerified for linux using bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signals09:47:12 UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay CommandRepresentative successful output; values vary with the selected target and system state.
Known errorspidstat: command not foundpidstat is missing or is not available on PATH.
Verifypidstat -d {{seconds}} {{count}} | awk '$4 ~ /^[0-9]+$/ {print}' | sort -k6,6nr | head -{{lines}}The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01pidstatCommandRuns the pidstat stage of this one-liner.
02-dOptionConfigures pidstat with the -d option.
03<seconds>ParameterA value supplied in the Fill parameters section.
04<count>ParameterA value supplied in the Fill parameters section.
05|PipelinePasses the output on the left to the command on the right.
06awkCommandRuns the awk stage of this one-liner.
07'$4 ~ /^[0-9]+$/ {print}'ArgumentPasses '$4 ~ /^[0-9]+$/ {print}' to awk.
08|PipelinePasses the output on the left to the command on the right.
09sortCommandRuns the sort stage of this one-liner.
10-k6,6nrOptionConfigures sort with the -k6,6nr option.
11|PipelinePasses the output on the left to the command on the right.
12headCommandRuns the head stage of this one-liner.
13-<lines>OptionConfigures head with the -<lines> option.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
pidstat -d 1 5 | awk '$4 ~ /^[0-9]+$/ {print}' | sort -k6,6nr | head -5
Example output
09:47:12 UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay Command
09:47:12 999 1442 0.00 18422.00 0.00 0 postgres
09:47:12 1001 8421 12.00 2481.00 0.00 0 node
Illustrative output — exact values vary by system and data.
Official sources