Tell a process PID by it's window?
up vote
46
down vote
favorite
How I can tell a process image name (to run from terminal using sudo) showing on the Ubuntu UI?
process
add a comment |
up vote
46
down vote
favorite
How I can tell a process image name (to run from terminal using sudo) showing on the Ubuntu UI?
process
1
Have a look here: stackoverflow.com/questions/2041532/…
– sulaweyo
May 16 '12 at 14:09
add a comment |
up vote
46
down vote
favorite
up vote
46
down vote
favorite
How I can tell a process image name (to run from terminal using sudo) showing on the Ubuntu UI?
process
How I can tell a process image name (to run from terminal using sudo) showing on the Ubuntu UI?
process
process
edited Apr 8 '15 at 8:44
muru
134k19283483
134k19283483
asked May 16 '12 at 13:06
Ted
3601311
3601311
1
Have a look here: stackoverflow.com/questions/2041532/…
– sulaweyo
May 16 '12 at 14:09
add a comment |
1
Have a look here: stackoverflow.com/questions/2041532/…
– sulaweyo
May 16 '12 at 14:09
1
1
Have a look here: stackoverflow.com/questions/2041532/…
– sulaweyo
May 16 '12 at 14:09
Have a look here: stackoverflow.com/questions/2041532/…
– sulaweyo
May 16 '12 at 14:09
add a comment |
5 Answers
5
active
oldest
votes
up vote
51
down vote
accepted
Per your request on the other question, here is my answer again:
I'm sure there is a cleaner way of doing it, but for your second question you can try this:
xprop _NET_WM_PID | sed 's/_NET_WM_PID(CARDINAL) = //' | ps `cat`
This will make your cursor a cross with which you can click on an open window. It will report the PID and command in the terminal you ran it in.
In general, xprop and xwininfo will provide you with a lot of information about an open window.
The "apostrophes" I used for surrounding cat are the ~ key on my keyboard without pressing shift. This should give you some more info on the subject:
Grave Accents and the backquote
xprop says: _NET_WM_PID: not found. This method not foolproof enough...
– Calmarius
Oct 3 '12 at 17:04
3
This is easier to remember:xprop | grep PID(although it only prints the process ID)
– KajMagnus
Jan 10 '13 at 11:26
add a comment |
up vote
13
down vote
You can try xprop | grep WM_CLASS and then click on the window you are interested in.
Examples:
#> xprop | grep WM_CLASS
WM_CLASS(STRING) = "gedit", "Gedit"
#> xprop | grep WM_CLASS
WM_CLASS(STRING) = "gcalctool", "Gcalctool"
add a comment |
up vote
7
down vote
Run this command in a terminal:
xprop | awk '/PID/ {print $3}'
Your mouse pointer will be replaced with crosshairs; select the window you're interested in.
This method shows just the PID of the process who owns that window (which appears to be what you want).
add a comment |
up vote
1
down vote
You can get process info using:
$ ps -f --pid $(xprop _NET_WM_PID | grep -o '[0-9]*')
add a comment |
up vote
0
down vote
Running xprop | awk '/_NET_WM_PID(CARDINAL)/{print $NF}' and clicking the window you want the PID of will print the PID to the terminal.
add a comment |
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
51
down vote
accepted
Per your request on the other question, here is my answer again:
I'm sure there is a cleaner way of doing it, but for your second question you can try this:
xprop _NET_WM_PID | sed 's/_NET_WM_PID(CARDINAL) = //' | ps `cat`
This will make your cursor a cross with which you can click on an open window. It will report the PID and command in the terminal you ran it in.
In general, xprop and xwininfo will provide you with a lot of information about an open window.
The "apostrophes" I used for surrounding cat are the ~ key on my keyboard without pressing shift. This should give you some more info on the subject:
Grave Accents and the backquote
xprop says: _NET_WM_PID: not found. This method not foolproof enough...
– Calmarius
Oct 3 '12 at 17:04
3
This is easier to remember:xprop | grep PID(although it only prints the process ID)
– KajMagnus
Jan 10 '13 at 11:26
add a comment |
up vote
51
down vote
accepted
Per your request on the other question, here is my answer again:
I'm sure there is a cleaner way of doing it, but for your second question you can try this:
xprop _NET_WM_PID | sed 's/_NET_WM_PID(CARDINAL) = //' | ps `cat`
This will make your cursor a cross with which you can click on an open window. It will report the PID and command in the terminal you ran it in.
In general, xprop and xwininfo will provide you with a lot of information about an open window.
The "apostrophes" I used for surrounding cat are the ~ key on my keyboard without pressing shift. This should give you some more info on the subject:
Grave Accents and the backquote
xprop says: _NET_WM_PID: not found. This method not foolproof enough...
– Calmarius
Oct 3 '12 at 17:04
3
This is easier to remember:xprop | grep PID(although it only prints the process ID)
– KajMagnus
Jan 10 '13 at 11:26
add a comment |
up vote
51
down vote
accepted
up vote
51
down vote
accepted
Per your request on the other question, here is my answer again:
I'm sure there is a cleaner way of doing it, but for your second question you can try this:
xprop _NET_WM_PID | sed 's/_NET_WM_PID(CARDINAL) = //' | ps `cat`
This will make your cursor a cross with which you can click on an open window. It will report the PID and command in the terminal you ran it in.
In general, xprop and xwininfo will provide you with a lot of information about an open window.
The "apostrophes" I used for surrounding cat are the ~ key on my keyboard without pressing shift. This should give you some more info on the subject:
Grave Accents and the backquote
Per your request on the other question, here is my answer again:
I'm sure there is a cleaner way of doing it, but for your second question you can try this:
xprop _NET_WM_PID | sed 's/_NET_WM_PID(CARDINAL) = //' | ps `cat`
This will make your cursor a cross with which you can click on an open window. It will report the PID and command in the terminal you ran it in.
In general, xprop and xwininfo will provide you with a lot of information about an open window.
The "apostrophes" I used for surrounding cat are the ~ key on my keyboard without pressing shift. This should give you some more info on the subject:
Grave Accents and the backquote
answered May 16 '12 at 19:19
Nimble
64165
64165
xprop says: _NET_WM_PID: not found. This method not foolproof enough...
– Calmarius
Oct 3 '12 at 17:04
3
This is easier to remember:xprop | grep PID(although it only prints the process ID)
– KajMagnus
Jan 10 '13 at 11:26
add a comment |
xprop says: _NET_WM_PID: not found. This method not foolproof enough...
– Calmarius
Oct 3 '12 at 17:04
3
This is easier to remember:xprop | grep PID(although it only prints the process ID)
– KajMagnus
Jan 10 '13 at 11:26
xprop says: _NET_WM_PID: not found. This method not foolproof enough...
– Calmarius
Oct 3 '12 at 17:04
xprop says: _NET_WM_PID: not found. This method not foolproof enough...
– Calmarius
Oct 3 '12 at 17:04
3
3
This is easier to remember:
xprop | grep PID (although it only prints the process ID)– KajMagnus
Jan 10 '13 at 11:26
This is easier to remember:
xprop | grep PID (although it only prints the process ID)– KajMagnus
Jan 10 '13 at 11:26
add a comment |
up vote
13
down vote
You can try xprop | grep WM_CLASS and then click on the window you are interested in.
Examples:
#> xprop | grep WM_CLASS
WM_CLASS(STRING) = "gedit", "Gedit"
#> xprop | grep WM_CLASS
WM_CLASS(STRING) = "gcalctool", "Gcalctool"
add a comment |
up vote
13
down vote
You can try xprop | grep WM_CLASS and then click on the window you are interested in.
Examples:
#> xprop | grep WM_CLASS
WM_CLASS(STRING) = "gedit", "Gedit"
#> xprop | grep WM_CLASS
WM_CLASS(STRING) = "gcalctool", "Gcalctool"
add a comment |
up vote
13
down vote
up vote
13
down vote
You can try xprop | grep WM_CLASS and then click on the window you are interested in.
Examples:
#> xprop | grep WM_CLASS
WM_CLASS(STRING) = "gedit", "Gedit"
#> xprop | grep WM_CLASS
WM_CLASS(STRING) = "gcalctool", "Gcalctool"
You can try xprop | grep WM_CLASS and then click on the window you are interested in.
Examples:
#> xprop | grep WM_CLASS
WM_CLASS(STRING) = "gedit", "Gedit"
#> xprop | grep WM_CLASS
WM_CLASS(STRING) = "gcalctool", "Gcalctool"
answered May 16 '12 at 14:15
Avio
2,24251636
2,24251636
add a comment |
add a comment |
up vote
7
down vote
Run this command in a terminal:
xprop | awk '/PID/ {print $3}'
Your mouse pointer will be replaced with crosshairs; select the window you're interested in.
This method shows just the PID of the process who owns that window (which appears to be what you want).
add a comment |
up vote
7
down vote
Run this command in a terminal:
xprop | awk '/PID/ {print $3}'
Your mouse pointer will be replaced with crosshairs; select the window you're interested in.
This method shows just the PID of the process who owns that window (which appears to be what you want).
add a comment |
up vote
7
down vote
up vote
7
down vote
Run this command in a terminal:
xprop | awk '/PID/ {print $3}'
Your mouse pointer will be replaced with crosshairs; select the window you're interested in.
This method shows just the PID of the process who owns that window (which appears to be what you want).
Run this command in a terminal:
xprop | awk '/PID/ {print $3}'
Your mouse pointer will be replaced with crosshairs; select the window you're interested in.
This method shows just the PID of the process who owns that window (which appears to be what you want).
edited Jan 25 '13 at 21:07
Eliah Kagan
80.8k20226364
80.8k20226364
answered Jan 25 '13 at 8:55
totti
4,88212942
4,88212942
add a comment |
add a comment |
up vote
1
down vote
You can get process info using:
$ ps -f --pid $(xprop _NET_WM_PID | grep -o '[0-9]*')
add a comment |
up vote
1
down vote
You can get process info using:
$ ps -f --pid $(xprop _NET_WM_PID | grep -o '[0-9]*')
add a comment |
up vote
1
down vote
up vote
1
down vote
You can get process info using:
$ ps -f --pid $(xprop _NET_WM_PID | grep -o '[0-9]*')
You can get process info using:
$ ps -f --pid $(xprop _NET_WM_PID | grep -o '[0-9]*')
answered Apr 8 '15 at 8:33
Wernight
88588
88588
add a comment |
add a comment |
up vote
0
down vote
Running xprop | awk '/_NET_WM_PID(CARDINAL)/{print $NF}' and clicking the window you want the PID of will print the PID to the terminal.
add a comment |
up vote
0
down vote
Running xprop | awk '/_NET_WM_PID(CARDINAL)/{print $NF}' and clicking the window you want the PID of will print the PID to the terminal.
add a comment |
up vote
0
down vote
up vote
0
down vote
Running xprop | awk '/_NET_WM_PID(CARDINAL)/{print $NF}' and clicking the window you want the PID of will print the PID to the terminal.
Running xprop | awk '/_NET_WM_PID(CARDINAL)/{print $NF}' and clicking the window you want the PID of will print the PID to the terminal.
answered May 16 '12 at 15:04
ScottKu
22617
22617
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f137875%2ftell-a-process-pid-by-its-window%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Have a look here: stackoverflow.com/questions/2041532/…
– sulaweyo
May 16 '12 at 14:09