Linux pstree命令將所有行程以樹狀圖顯示,樹狀圖將會以 pid (如果有指定) 或是以 init 這個基本行程為根 (root),如果有指定使用者 id,則樹狀圖會只顯示該使用者所擁有的行程。
使用權限:所有使用者。
pstree [-a] [-c] [-h|-Hpid] [-l] [-n] [-p] [-u] [-G|-U] [pid|user]
或
pstree -V
參數(shù)說明:
顯示進程的關系
pstree init-+-amd |-apmd |-atd |-httpd---10*[httpd] %pstree -p init(1)-+-amd(447) |-apmd(105) |-atd(339) %pstree -c init-+-amd |-apmd |-atd |-httpd-+-httpd | |-httpd | |-httpd | |-httpd ....
特別表明在運行的進程
# pstree -apnh //顯示進程間的關系
同時顯示用戶名稱
# pstree -u //顯示用戶名稱