linux系统中查看进程的命令有ps、top、pstree……还有一些各种显示的监控工具程序。
一个进程运行中,很可能会有其他的子进程随之运行,而使用pstree命令就可以非常清楚简洁的看到这些子进程与父进程的关系了。
pstree命令直接使用,将显示系统中的进程树,可以清晰的显示出系统中的进程结构。
[root@searu ~]# pstree
pstree命令直接使用时显示系统中的进程树
Usage: pstree [ -a ] [ -c ] [ -h | -H PID ] [ -l ] [ -n ] [ -p ] [ -u ]
[ -A | -G | -U ] [ PID | USER ]
pstree -V
Display a tree of processes.
-a show command line arguments
-A use ASCII line drawing characters
-c don't compact identical subtrees
-h highlight current process and its ancestors
-H PID highlight this process and its ancestors
-G use VT100 line drawing characters
-l don't truncate long lines
-n sort output by PID
-p show PIDs; implies -c
-u show uid transitions
-U use UTF-8 (Unicode) line drawing characters
-V display version information
-Z show SELinux security contexts
PID start at this PID; default is 1 (init)
USER show only trees rooted at processes of this user