Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Wat het doet
pstree draws the processes from systemd (PID 1) down. Identical children are compacted: httpd───5*[httpd] means five httpd children. Use -p for PIDs and -a for the full command lines.
Zo schrijf je het
pstree [OPTION]... [PID | USER]Opties 20
Meest gebruikt
Niets past bij dit filter.
Voorbeelden 10
$ als gewone gebruiker# als root (of met sudo)
1The whole tree
pstree | head systemd─┬─NetworkManager───3*[{NetworkManager}] ├─chronyd ├─sshd───sshd───sshd───bash───pstree{…} are threads.
2With PIDs
pstree -p | headFind the PID of a parent quickly.
3Tree of one process
pstree -p 1010Only the sshd master and its sessions.
4Where does my shell come from?
pstree -s -p $$ systemd(1)───sshd(1010)───sshd(2210)───sshd(2215)───bash(2216)The chain of parents.
5Show the user of each part
pstree -u(apache)shows where a process changed to another user.6Full command lines
pstree -a | lessShows the options of each program.
7Processes of one user
pstree lisaAll trees owned by lisa.
8Find odd children of a web server (security)
pstree -p -a $(pgrep -o httpd)A shell (bash, sh) under httpd can mean a web shell attack.
9Do not compact
pstree -c -p | grep httpdEvery child on its own line.
10Container namespaces
pstree -N pidSeparate trees for each PID namespace (containers).
Niets past bij dit filter.
Exitcodes
0 :: Done. 1 :: Error.