Quick Linux Tip #65:
Question: How do I see all child processes spawned by a parent?
Try: pstree -pau 3456
Info: pstree displays process hierarchies. -p includes PIDs, -a shows full command arguments, and -u lists usernames. Curly braces {} indicate threads.
Examples:
- $
pstree -pau $$# View process tree starting from current shell - $
pstree -T# Hide threads to show only main processes - $
pstree -sp 3456# Show parent ancestors leading up to PID 3456
Note: pstree is useful for identifying orphaned processes and understanding child process trees. Threads shown inside {} share the parent process's memory space.
Leave a Reply