I want to run top so that it opens as if you hit the m key, what I really want is this:
How to run ''top'' command 1 time and exit?
But I want to
a) have the 'm' key hit b) sort by memory (shift-m)
Can this be done from the command line?
Thanks, Kevin
update - showing what i am seeking from command line without having to hit any key:
Just an update to clarify i need BOTH the sort by AND the memory showing, in a single command line, the given solution only solves the sort request. Thanks for any help.