Mac OSX – Reset ‘Top’ Command Default View

command linemacosterminalunix

I met a problem when using linux top command on macOS. The default top open view now looks like

Current top view

It displays too many unnecessary columns and didn't sort by CPU or MEM by default. I remember it used to be like

old top view

Anyone know how to change it back? I've checked my home folder that there is no .toprc file.

Thanks in advance.

Best Answer

top will generally display as many columns as the width of your window will allow. But to change the sort to cpu (high to low), you can type the following within top:

o to select primary sort

-cpu to sort by decreasing CPU usage

You can add a secondary sort if desired:

O to select secondary sort

-mem to sort by decreasing memory usage

? will show you all options, along with the current sort selections - see below image: enter image description here

You can also call these options explicitly from the command line, if desired, like this:

To see your longest running processes

top -o time -user $(whoami)