Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 32 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
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


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.