Reverse order using command

4

Is there a way i use the ps --sort option on a linux to display the processes in reverse order based on the process ID or is there another command i can use for this?

Beginnernato

Posted 2012-09-29T22:14:28.547

Reputation:

Answers

8

Ascending:

ps ax --sort +pid

Descending

ps ax --sort -pid

Kerrek SB

Posted 2012-09-29T22:14:28.547

Reputation: 811

0

If that's the Linux ps command we're discussing,

ps --sort='-pid'

Fred Foo

Posted 2012-09-29T22:14:28.547

Reputation: 985

0

you can use this also for sorting the pid

ps -ax | sort -n 

ps -ax is for display all process with pid. sort -n for numeric sort

reegan vijay

Posted 2012-09-29T22:14:28.547

Reputation: 1

0

You can use tac command also

tac command print files in reverse


ps -aux --sort -pid

and

ps -aux | tac

user162334

Posted 2012-09-29T22:14:28.547

Reputation: