How to get a specific PID #

Ralf Mardorf silver.bullet at zoho.com
Wed Dec 30 21:14:53 UTC 2015


On Wed, 30 Dec 2015 21:57:24 +0100, I wrote:
>On Wed, 30 Dec 2015 22:20:28 +0200, Amichai Rotman wrote: 
>>Just use the 't' key to switch htop to 'tree mode'.  
>
>How does this show what xfw window belongs to what PID?
>
>  1  [||                                        2.8%]     Tasks: 59,
> 83 thr; 1 running 2  [|||
> 4.2%]     Load average: 0.03 0.04 0.05
> Mem[||||||||||||||||||||||||||||||||||||840/3704MB]     Uptime: 2
> days, 21:45:15 Swp[|                                    19/4706MB]
>
>  PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
> 7665 rocketmou  20   0  123M 14020 11652 S  0.0  0.4  0:00.19 ├─ xfw
> 7663 rocketmou  20   0  123M 13960 11592 S  0.0  0.4  0:00.14 ├─ xfw

By the following example you can see, when using wmctrl I can see what
instance of pluma, IOW what window, belongs to what PID, but for xfw the
PIDs aren't displayed correctly. As shown by an earlier reply, even if
window title bars should share the same name, it's possible to change
the name with wmctrl, but this only makes sense, if it also displays the
PID.

$ ps aux|grep -v grep|grep xfw
rocketm+ 28733  0.2  0.3 126964 13836 pts/4    S+   14:25   0:00 xfw
root     28734  0.0  0.1  72312  5216 pts/3    S+   14:26   0:00 sudo xfw
root     28735  0.2  0.3 127744 14220 pts/3    S+   14:26   0:00 xfw
$ ps aux|grep -v grep|grep pluma
rocketm+ 28736  4.0  1.0 625936 40996 pts/2    Sl+  14:26   0:03 pluma
root     28741  0.0  0.1  72312  5112 pts/1    S+   14:26   0:00 sudo pluma
root     28742  3.1  0.8 991168 32152 pts/1    Sl+  14:26   0:01 pluma
$ wmctrl -lp
0x00a00003 -1 25836  archlinux panel
0x00e0001d -1 25835  archlinux panel
0x00800007  0 28670  archlinux rocketmouse at archlinux:~
0x014004be  0 0            N/A .jackdrc - /home/rocketmouse
0x018004bf  0 0            N/A .bashrc - /root
0x01a00114  0 28736  archlinux .jackdrc (~) - Pluma
0x01c00110  0 28742  archlinux .bashrc (~) - Pluma

Regards,
Ralf





More information about the ubuntu-users mailing list