


This switch can then take keys that are either prefixed with a + or a - to denote the sort order.least to greatest or greatest to least. $ ps aux | sort -rn -k 5,6 | less -SĬertain versions of ps provide the ability to use -sort. You can then use your arrow keys to move left/right/up/down to see all of it.

If your output is wrapping a lot you can also utilize the -S switch to less, which will force all the output to stay on a single line instead. This allows you to look at the information a page at a time and also use the arrow keys and page up/down keys to scroll back and forth through the output. Root 982 0.0 0.0 0 0 ? S 07:04 0:00 Īn additional tip would be to pipe the entire output to another command such as less. USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND This doesn't handle for the column headers which get mixed in with the output, but it's easy to remember on the command line, and is an acceptable way to do what you want when manually viewing this type of output. A quick and dirty method is to just pipe the output of ps aux to the sort command: $ ps aux | sort -rn -k 5,6
