How to get a specific PID #

Ralf Mardorf silver.bullet at zoho.com
Wed Dec 30 20:57:24 UTC 2015


On Wed, 30 Dec 2015 22:20:28 +0200, Amichai Rotman wrote:
>On Dec 30, 2015 3:48 PM, "Ralf Mardorf" <silver.bullet at zoho.com> wrote:
>
>> On Wed, 30 Dec 2015 12:09:39 +0100, I wrote:  
>> >>xkill  
>> >
>> >If the OP wants to know what PID belongs to what window, then
>> >wmctrl is the way to go. There are exceptions, when wmctrl does not
>> >provide the PID, but usually it does provide it. However, I doubt
>> >that xkill would work, if a program doesn't provide a real window
>> >anymore, but wmctrl usually allows to at least determine the PID of
>> >the instances that still work as expected, so the OP just needs to
>> >kill the remaining PID by htop, kill or another command line tool.  
>>
>> Assumed somebody wants to know an exceptional case when wmctrl
>> doesn't show the PID:
>>
>>
>> https://lists.archlinux.org/pipermail/arch-general/2015-December/040347.html
>>
>> I can't reboot to my Ubuntu install now, so I only could test it with
>> the Linux I'm currently running.
>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

Regards,
Ralf
 





More information about the ubuntu-users mailing list