M BUZZ CRAZE NEWS
// news

How to set memory usage sort in top command as default?

By Emma Johnson

I want to sort the memory usage in top command as default. So that i do not have to sort in every i run top command.

How to do that?

Thanks in advance....

1 Answer

Start it with

top -o %MEM

You can create an alias: alias top='top -o %MEM' in ~/.bashrc) for this.

Easier method: top can save to a configuration using W.

W :Write-the-Configuration-File This will save all of your options and toggles plus the current display mode and delay time. By issuing this command just before quitting top, you will be able to restart later in exactly that same state.

It saves to ~/.toprc. Going back to default is the same as removing ~/.toprc.

6

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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