Print a sortable one-shot Docker resource table
Build a paste-ready command, then review its compatibility and effects before running it.
docker stats --no-stream --format '{{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}' | sort -k2 -hrread-onlyno known side effects Compatibility
Linux + macOSVerified for Linux, macOS using bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementsdockerdocker must be installed and available on PATH.
Version supportdocker Current supported releasesVerified for linux, macos using bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsworker 92.14% 1.42GiB / 4GiB 1.2GB / 88MB 4.1GB / 2.3GBRepresentative successful output; values vary with the selected target and system state.
Known errorsdocker: command not founddocker is missing or is not available on PATH.
Verifydocker stats --no-stream --format '{{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}' | sort -k2 -hrThe 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
01dockerCommandRuns the docker stage of this one-liner.
02statsArgumentPasses stats to docker.
03--no-streamOptionConfigures docker with the --no-stream option.
04--formatOptionFormats each result using the supplied template.
05'{{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}'ArgumentPasses '{{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}' to docker.
06|PipelinePasses the output on the left to the command on the right.
07sortCommandRuns the sort stage of this one-liner.
08-k2OptionConfigures sort with the -k2 option.
09-hrOptionConfigures sort with the -hr option.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
docker stats --no-stream --format '{{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}' | sort -k2 -hr
Example output
worker 92.14% 1.42GiB / 4GiB 1.2GB / 88MB 4.1GB / 2.3GB
api 18.03% 624MiB / 2GiB 410MB / 990MB 620MB / 18MB
Illustrative output — exact values vary by system and data.
Official sources