Change top’s sorting back to CPU

top

A former coworker did something to top that whenever it runs as root the data is sorted by MEM usage instead of the default CPU usage. According to multiple searches, the man page and even the options within the top console itself (O), just pressing k it should be sorted by CPU, but instead when I hit k it asks me for a pid to kill.

So how can I get back default sorting to CPU?

Best Answer

You can change the sort field in the interactive top window with the < and > keys. I'm not sure what operating system you're running but at least on my GNU top, k is supposed to kill, not reset.

Presumably, your friend changed the sort field and hit Shift+W to save to ~/.toprc. Just use the keys I mentioned to choose the sort field you want and then, when it's set up as you like it, hit Shift+W again and it should save that state and open that way next time.

Related Question