Make OSX’s top behave like Linux’s top

OSX’s top program doesn’t quite behave like its Linux counterpart out of the box. For me, the two biggest problems are that processes aren’t sorted by CPU usage and the top program itself uses 10% of the CPU because it calculates all sorts of statistics about memory and shared library usage that I personally don’t care about.

There are a series of flags that you can pass to OSX’s top to have its behavior be closer to Linux’s top. I have created the following alias to that effect :

alias mytop='top -s1 -o cpu -R -F'

The display is updated every second, processes sorted by CPU usage and no unnecessary statistics are calculated. Instead of 10%, top uses only 2% of the CPU.

4 thoughts on “Make OSX’s top behave like Linux’s top

  1. Micah Stupak

    Hello, thanks for this as I had been trying to figure out some good settings for OS X top for a while. Do you know if it is possible to use interactive mode, though? (Sorry to leave a comment on an old blog post.)

  2. fread2281

    Micah Stupak :
    Hello, thanks for this as I had been trying to figure out some good settings for OS X top for a while. Do you know if it is possible to use interactive mode, though? (Sorry to leave a comment on an old blog post.)

    try htop, its on homebrew and macports.
    these settings are for interactive mode, though.

  3. Micah Stupak

    Oh, thanks for the tip on htop. Got it off macports and it’s exactly what I’m looking for.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.