Show a process subtree with PIDs and command arguments
Build a paste-ready command, then review its compatibility and effects before running it.
pstree -aps <process-id>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
Requirementspstreepstree must be installed and available on PATH.
Version supportpstree Current supported releasesVerified for linux using bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalssystemd,1Representative successful output; values vary with the selected target and system state.
Known errorspstree: command not foundpstree is missing or is not available on PATH.
Verifypstree -aps {{processId}}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
01pstreeCommandRuns the pstree stage of this one-liner.
02-apsOptionConfigures pstree with the -aps option.
03<process-id>ParameterA value supplied in the Fill parameters section.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
pstree -aps 8421
Example output
systemd,1
└─containerd-shim,8120 -namespace moby
└─node,8421 server.js
├─node,8437 worker.js
└─{node},8441
Illustrative output — exact values vary by system and data.
Official sources