APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

ps sorting

© September 2005 Tony Lawrence
September 2005

In the beginning, when large creatures lumbered through damp tropical forests and furry mammals hid quivering in their burrows, "ps" had no built in abilty to change its sort order. You got what it gave, and if you wanted it otherwise, you ran it through "sort" yourself. That is the Unix Way: small tools, working together with pipelines.

BSD mucked with that a bit, adding a "-m" option that sorted by memory usage, instead of by process ID. As that's a pretty common desire, I doubt anyone saw that as an offense to the Unix gods, though really it was. But it was convenient, wasn't it?

But now Linux ps adds something much more nasty. Not only does Linux ps have a built-in "--sort" option (added by Charles Blake, so says the man page), it also overloads "-O" which originally was used for user defined formats (specifying the fields you want to see) to do the same thing. Sacrilege! The sanctity of the Unix Way is violated by this insertion. Do you see what happens when you let the camel poke his nose in the tent? That little "-m" was so convenient, and now look at this mess! Pretty soon ps will be drawing graphs and outputting html!

I'm only half kidding. Linux ps with --sort can be convenient, but it is also feature bloat and I'm not entirely happy to see that. Too much camel in the tent, I think.

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> ps sorting

Inexpensive and informative Apple related e-books:

Take Control of Numbers

Take Control of iCloud

Take Control of Apple Mail, Third Edition

iOS 10: A Take Control Crash Course

Take Control of High Sierra

More Articles by © Tony Lawrence

Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

Any inaccuracies in this index may be explained by the fact that it has been sorted with the help of a computer. (Donald Knuth)

Linux posts

Troubleshooting posts

This post tagged:


Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode