Get pid of a process - Linux

This is a discussion on Get pid of a process - Linux ; Hi, command "ps -ef | grep Controller" give me the list of all process running... say, nsmail 11594 11593 0 Sep 07 ? 0:00 mailController ms01.mac.com nsmail 11680 11594 0 Sep 07 ? 0:00 mailController ms01.mac.com nsmail 11683 11594 0 ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Get pid of a process

  1. Get pid of a process

    Hi,

    command "ps -ef | grep Controller" give me the list of all process
    running...

    say,

    nsmail 11594 11593 0 Sep 07 ? 0:00 mailController
    ms01.mac.com
    nsmail 11680 11594 0 Sep 07 ? 0:00 mailController
    ms01.mac.com
    nsmail 11683 11594 0 Sep 07 ? 0:00 mailController
    ms01.mac.com

    Now i would like to get only the Pids of "mailController ms01.mac.com"
    ?????

    What should be the command????

    -Kimi


  2. Re: Get pid of a process

    shafa.fahad@gmail.com wrote:
    > Hi,
    >
    > command "ps -ef | grep Controller" give me the list of all process
    > running...
    >
    > say,
    >
    > nsmail 11594 11593 0 Sep 07 ? 0:00 mailController
    > ms01.mac.com
    > nsmail 11680 11594 0 Sep 07 ? 0:00 mailController
    > ms01.mac.com
    > nsmail 11683 11594 0 Sep 07 ? 0:00 mailController
    > ms01.mac.com
    >
    > Now i would like to get only the Pids of "mailController ms01.mac.com"
    > ?????
    >
    > What should be the command????


    TMTOWTDI

    ps -ef | grep 'Controller.*ms01.mac.com'
    ps -ef | grep Controller | grep ms01.mac.com


    --
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize
    -- T. Pratchett


  3. Re: Get pid of a process

    Josef Moellers wrote:
    > shafa.fahad@gmail.com wrote:
    >> Hi,
    >>
    >> command "ps -ef | grep Controller" give me the list of all process
    >> running...
    >>
    >> say,
    >>
    >> nsmail 11594 11593 0 Sep 07 ? 0:00 mailController
    >> ms01.mac.com
    >> nsmail 11680 11594 0 Sep 07 ? 0:00 mailController
    >> ms01.mac.com
    >> nsmail 11683 11594 0 Sep 07 ? 0:00 mailController
    >> ms01.mac.com
    >>
    >> Now i would like to get only the Pids of "mailController ms01.mac.com"
    >> ?????
    >>
    >> What should be the command????

    >
    > TMTOWTDI
    >
    > ps -ef | grep 'Controller.*ms01.mac.com'
    > ps -ef | grep Controller | grep ms01.mac.com
    >
    >

    SEE ALSO:
    pgrep

+ Reply to Thread