How to display %cpu for targeted process - HP UX

This is a discussion on How to display %cpu for targeted process - HP UX ; Hello, I'm trying to find away how to display certain process with cpu utilization process. I can do top and get a screen of process information that is being updated from time to time. This is great. But I can't ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How to display %cpu for targeted process

  1. How to display %cpu for targeted process

    Hello,

    I'm trying to find away how to display certain process with cpu
    utilization process.

    I can do top and get a screen of process information that is being
    updated from time to time.

    This is great. But I can't grep top to filter out all unwanted
    information.

    Other command that I have tried is ps. This is another great command.
    I can do :

    ps -ef | grep name

    And get the named proces information.

    Unfortunately ps with -f flag doesn't display cpu percentage (%CPU).

    According to manpage I should do ps -eo pcpu to get the %CPU column.
    However I get the following error:

    >> ps -eo pcpu

    ps: illegal option -- o

    My question?

    1. Anyway I can grep top output?
    2. Why I can't do ps -eo?

    Thanks in advance!

  2. Re: How to display %cpu for targeted process

    In article <34f36287-9198-42ef-827a-c67562de7370@i12g2000prf.googlegroups.com>,
    harishashim@gmail.com writes:
    > Hello,
    >
    > I'm trying to find away how to display certain process with cpu
    > utilization process.
    >
    > I can do top and get a screen of process information that is being
    > updated from time to time.
    >
    > This is great. But I can't grep top to filter out all unwanted
    > information.
    >
    > Other command that I have tried is ps. This is another great command.
    > I can do :
    >
    > ps -ef | grep name
    >
    > And get the named proces information.
    >
    > Unfortunately ps with -f flag doesn't display cpu percentage (%CPU).
    >
    > According to manpage I should do ps -eo pcpu to get the %CPU column.
    > However I get the following error:
    >
    >>> ps -eo pcpu

    > ps: illegal option -- o
    >
    > My question?
    >
    > 1. Anyway I can grep top output?
    > 2. Why I can't do ps -eo?
    >
    > Thanks in advance!


    Well, you can define the environment variable UNIX95 to use extended versions of various command (like ps):

    UNIX95= ps -eo pcpu

    Then you might use glance or gpm (if installed).


    Yours, Hans Martin Schwengeler


+ Reply to Thread