↑ ↓ select, Enter open, Esc close

Show processes as a tree with parents and children

user@server
ps -ef --forest

Lists all processes with user, PID and parent PID (PPID) and indents child processes under their parent. This shows whether a suspicious PHP process belongs to a cron job, to php-fpm or to an SSH session. Append | less -S to page through the long output without line wrapping.

Note: If you prefer pstree: pstree -ap from the psmisc package gives a more compact view.

Also searched as

  • show process tree
  • who started this process
  • find parent process
  • pstree alternative

Related one-liners

All in Processes

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.