Link to home
Start Free TrialLog in
Avatar of Phoebe
Phoebe

asked on

CPU Load for each process.

How can I check CPU time used by each process?

In other words, How can I check which process is the first
one to use the CPU,  and which is second one.
Avatar of tfewster
tfewster
Flag of United Kingdom of Great Britain and Northern Ireland image

ps -l will show you the actual CPU time used by a process (TIME) and the priority (NI [nice]) columns;

Which process gets the CPU first depends on the type of job plus the "nice" value under solaris - man  priocntl will tell you more, but if all priorities are equal the processes will get equal CPU time.
Avatar of sampayo
sampayo

Try this out

ps aux |sed '1s/%/:/' |sort -r +2 |\
sed '1s/:/%/' |more
Avatar of ozo
top
Avatar of Phoebe

ASKER

when I click in the command. I was told


bidwelluat% ps aux | sed 'ls/%/:/' | sort -r +2 |\
sed 'ls/:/%/' | more
usage: ps [ -aAdeflcjLPy ] [ -o format ] [ -t termlist ]
        [ -u userlist ] [ -U userlist ] [ -G grouplist ]
        [ -p proclist ] [ -g pgrplist ] [ -s sidlist ]
  'format' is one or more of:
        user ruser group rgroup uid ruid gid rgid pid ppid pgid sid
        pri opri pcpu pmem vsz rss osz nice class time etime stime
        f s c lwp nlwp psr tty addr wchan fname comm args


Sorry I forgot telling you that I working on Solaris 2.6
ASKER CERTIFIED SOLUTION
Avatar of tfewster
tfewster
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
good for you tfewster
I guess there isn't much interpolation.
Avatar of Phoebe

ASKER


!!! GREAT !!!