推荐一个跨操作系统进程树脚本---pstree
[batman@chaosbatman]$
./sps
/bin/ps
-e
-o
user,pid,ppid,vsz,pcpu,time,comm
USER
PID
PPID
VSZ
%CPU
TIME
COMMAND
root
1
0
1412
0.0
00:00:04
+-init
.......
root
906
1
2264
0.0
00:00:00
|
+-xinetd
root
5503
906
1520
0.0
00:00:00
|
|
+-in.telnetd
root
5504
5503
2340
0.0
00:00:00
|
|
|
+-login
batman
5505
5504
2456
0.0
00:00:00
|
|
|
+-bash
root
5551
5505
2356
0.0
00:00:00
|
|
|
+-su
root
5552
5551
2556
0.0
00:00:00
|
|
|
+-bash
root
6176
906
1520
0.0
00:00:00
|
|
+-in.telnetd
root
6177
6176
2340
0.0
00:00:00
|
|
|
+-login
batman
6178
6177
2456
0.0
00:00:00
|
|
|
+-bash
root
6224
6178
2356
0.0
00:00:00
|
|
|
+-su
root
6225
6224
2556
0.0
00:00:00
|
|
|
+-bash
root
6328
6225
2356
0.0
00:00:00
|
|
|
+-su
root
6329
6328
2608
0.0
00:00:00
|
|
|
+-bash
.......