Results 1 to 7 of 7

Thread: How to find process name from application name

  1. #1
    Join Date
    Sep 2007
    Beans
    183

    Question How to find process name from application name

    Hi,

    I have searched for the solution with no luck and still wondering if there is a way to find out what's an application process name is from the name of the application itself. And then pkill the process from the terminal.

    I tried using

    Code:
    ps -e | grep ....
    but it says

    Code:
    Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
    Any ideas?

    Thanks

  2. #2
    Join Date
    Mar 2010
    Beans
    8,249
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to find process name from application name

    Try this:

    Code:
    ps -C <name_of_program> -o pid=
    You can also work this the other way round; find the process name from the PID:

    Code:
     ps -p <PID> -o comm=
    Last edited by Rubi1200; October 19th, 2010 at 07:29 PM.

  3. #3
    Join Date
    Sep 2007
    Beans
    183

    Re: How to find process name from application name

    Thanks, but what value should the pid get form the first code?

  4. #4
    Join Date
    Mar 2010
    Beans
    8,249
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to find process name from application name

    Quote Originally Posted by pooyaplus View Post
    Thanks, but what value should the pid get form the first code?
    I am not sure I understand what you mean by value?

    Example, I am currently running Firefox:

    Code:
    ps -C firefox -o pid=
    return this
    Code:
    2189
    2189 is the PID for Firefox.

    Or did I misunderstand your original post concerning what you want to do?

  5. #5
    Join Date
    Sep 2007
    Beans
    183

    Re: How to find process name from application name

    Right... but how do I get the process name? In case that I want to kill the same process frequently as the pid does change when you start it over again?

    Here is an example: how do you get the process name of the "Hardware Drivers" application from the system> advanced menu?

    Cheers

    P.

  6. #6
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: How to find process name from application name

    In the case of Hardware Drivers or any other, you can always check System->Preferences->Main Menu, select the menu item and click properties, you will see that the name of the application is jockey-gtk. You can then open a terminal and type:

    Code:
    ps ax | grep jockey-gtk
    the result of the above command, should look like this:

    Code:
    ps ax | grep jockey-gtk
     2481 ?        Sl     0:00 /usr/bin/python /usr/bin/jockey-gtk
     2529 pts/4    S+     0:00 grep --color=auto jockey-gtk
    the first line in the result gives you the full path of the application and it's pid.

  7. #7
    Join Date
    Sep 2007
    Beans
    183

    Question Re: How to find process name from application name

    Hi,

    Thanks so much for the insights, but is there a way to get all that info regarding the process name from the terminal instead of checking the properties of the app?

    Cheers

    P.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •