Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there any package which shows PID of a window by clicking on it?

share|improve this question

2 Answers 2

up vote 18 down vote accepted

Yes. Try xprop and you are looking for the value of _NET_WM_PID:

xprop _NET_WM_PID | cut -d' ' -f3
{click on window}
share|improve this answer
8  
Note that this information is provided voluntarily by the client and need not be correct, present or meaningful (remote clients, clients in a separate PID namespace). –  Simon Richter Aug 22 '11 at 13:23

xprop will return a window's PID.

You can filter the verbose output using awk:

xprop | awk '/PID/ {print $3}'
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.