5

How can i sort active processes by total process time in unix?

warren
  • 18,369
  • 23
  • 84
  • 135
user36468
  • 51
  • 1

3 Answers3

3

I would do something like:

ps -A -o cmd,etime --sort etime

If by 'process time' you mean elapsed wall clock time of the process. Other time options are:

   j     cutime       cumulative user time
   J     cstime       cumulative system time
   k     utime        user time
Kyle Brandt
  • 83,619
  • 74
  • 305
  • 448
2

If I understand you well, you can run top and press T.

chmeee
  • 7,370
  • 3
  • 30
  • 43
2

You should be able to use ps Ok (O - order, k - user time), and apply selection and formatting options as needed.

Kjetil Joergensen
  • 5,994
  • 1
  • 27
  • 20