Sort ps results by start time

I show current process information using this variety of ps command:

 ps -eo pid,start,stime,command 

How can I sort these results from the beginning?

I read man ps and tried sorting options -m , -r and -v . Unfortunately, I could not use these options to sort by start.

+4
source share
1 answer

You are using etime . This is the elapsed time, in days, hours, etc., which is suitable for sorting numerically. If this is the first column, I think ps will automatically sort it.

Otherwise, you can override the sort order with --sort , but make sure it is after the -o option, for example:

 ps -o pid,user:32,start,etime,state,time,vsz,args --sort=etime 
+4
source

Source: https://habr.com/ru/post/1384012/


All Articles