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?

9

Ascending:

ps ax --sort +pid

Descending

ps ax --sort -pid
| improve this answer | |
0

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

ps --sort='-pid'
| improve this answer | |
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

| improve this answer | |
0

You can use tac command also

tac command print files in reverse


ps -aux --sort -pid

and

ps -aux | tac
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy