How can I identify the name of a running application?

Asked by Jimmy Volatile

Hi.

How can I identify the name, command or PID of a running desktop application? Is it possible at all?

I tried opening top in gnome-terminal but the list of running applications is very long. Is there a way to identify a running application by pointing and clicking at it or is there another clever way?

Or is the only option to:
1. Use top or htop and look for something familiar
2. Look for the icon in the menus, then open the menu editor and
3. Ask for the application name at the forums?

The reason I'm asking is two-fold:
1. I'd like to report bugs against several unknown gui applications using [ linux-bug <name-of-app> ]
2. I'd like to be able to start various applications from the command line.

Any help will be greatly appreciated.
Thanks in advance :)

Question information

Language:
English Edit question
Status:
Solved
For:
gnome-desktop Edit question
Assignee:
No assignee Edit question
Solved by:
B. Clausius
Solved:
Last query:
Last reply:
Revision history for this message
Best B. Clausius (barcc) said :
#1

You can use the command xprop to find this infos.
Type
    xprop | grep PID
click on an application window and you get a line like this
    _NET_WM_PID(CARDINAL) = 10177

To find the command of the app type
    ps -A | grep 10177

All in one line:
    ps -A | grep $(xprop | grep PID | awk '{ print $3 }')

and you get a line with pid and command:
   10177 ? 00:30:39 firefox-3.5

Hope that helps

Revision history for this message
Jimmy Volatile (spam-useful) said :
#2

Thanks B Clausius, that solved my question.

Revision history for this message
Jimmy Volatile (spam-useful) said :
#3

Fantastic!

This really works well. Thanks a lot!
Is word of mouth the only way to learn about things like this or is it more the case of reading every man page available + years of experience with Linux?

Thanks, anyway. Now I'll try putting this into a .sh file and link to it from a launcher/shortcut on the top bar.