X 를 사용하면서 top 을 해 보면 쓸데 없는 프로세스까지 다 튀어 나와서 정작 내가 보려는 프로세스가 잘 안보인다.
procps-3.2.7 의 top.c 를 약간 바꿔 보았다.
-o name : cmdline 명령어가 name* 인 프로세스들만 (only) 보여 줌
-O name : cmdline 명령어가 name* 인 프로세스들은 안보여줌.
사용례
$ top -o xterm -o bash -o gnome
mtop - 14:05:30 up 1 day, 4:11, 26 users, load average: 0.48, 0.52, 0.43
Tasks: 178 total, 2 running, 174 sleeping, 0 stopped, 2 zombie
Cpu(s): 16.7%us, 3.4%sy, 0.0%ni, 79.9%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 2074648k total, 1968628k used, 106020k free, 74908k buffers
Swap: 4000144k total, 33828k used, 3966316k free, 882208k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
19727 shawn 20 0 10308 4248 2528 S 0.4 0.2 7:10.57 xterm
7084 shawn 20 0 55016 23m 16m S 0.2 1.1 1:07.76 gnome-panel
1865 shawn 20 0 10376 4172 2504 S 0.0 0.2 0:00.16 xterm
1866 shawn 20 0 4784 2124 1400 S 0.0 0.1 0:00.04 bash
3248 shawn 20 0 10804 4656 2508 S 0.0 0.2 0:00.28 xterm
3249 shawn 20 0 4780 2120 1400 S 0.0 0.1 0:00.06 bash
6386 shawn 20 0 10220 4080 2516 R 0.0 0.2 0:00.08 xterm
6387 shawn 20 0 4768 2076 1372 S 0.0 0.1 0:00.02 bash
6934 shawn 20 0 14464 2152 1752 S 0.0 0.1 0:00.00 gnome-keyring-d
7052 shawn 20 0 32144 9m 7860 S 0.0 0.5 0:36.18 gnome-settings-
7083 shawn 20 0 15836 5000 3908 S 0.0 0.2 1:00.29 gnome-screensav
7208 shawn 20 0 24088 8956 6580 S 0.0 0.4 0:12.94 gnome-power-man
7209 shawn 20 0 21056 4820 3576 S 0.0 0.2 0:00.48 gnome-volume-ma
8822 shawn 20 0 10500 4376 2528 S 0.0 0.2 0:00.42 xterm
8823 shawn 20 0 4784 2124 1400 S 0.0 0.1 0:00.12 bash
9028 shawn 20 0 10720 4556 2536 S 0.0 0.2 0:03.32 xterm
9029 shawn 20 0 4768 2080 1372 S 0.0 0.1 0:00.00 bash
10126 shawn 20 0 10172 4020 2508 S 0.0 0.2 3:03.01 xterm
10127 shawn 20 0 4768 2076 1372 S 0.0 0.1 0:00.00 bash
19728 shawn 20 0 4792 2136 1408 S 0.0 0.1 0:00.06 bash
19763 shawn 20 0 10392 4348 2532 S 0.0 0.2 0:00.96 xterm
19764 shawn 20 0 4796 2160 1428 S 0.0 0.1 0:00.54 bash
22642 shawn 20 0 10096 3144 2504 S 0.0 0.2 0:00.16 xterm
22643 shawn 20 0 4784 2124 1404 S 0.0 0.1 0:00.06 bash
22657 shawn 20 0 10536 4324 2496 S 0.0 0.2 0:00.12 xterm
22658 shawn 20 0 4816 2152 1396 S 0.0 0.1 0:00.02 bash
22677 shawn 20 0 10096 3196 2500 S 0.0 0.2 0:00.36 xterm
22678 shawn 20 0 4820 2160 1400 S 0.0 0.1 0:00.04 bash
diff 는 첨부했으니 패치해서 빌드한 후 쓰면 된다.