Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Unix utilities on Mac OS X are quite painful to use. port install coreutils +with_default_names and a few other such replacements fix most of them, but it leaves some in broken Mac OS X defaults - most annoyingly top and netstat, but I'm sure I could think of a few more.

I'm guessing that commands like top and netstat are quite OS specific, so just grabbing sources of their Linux equivalents and recompiling won't work.

What's the best equivalent of these and other such commands that works on Mac OS X?

share|improve this question
Calling them "replacements" may not be historically accurate. They are derived from the BSD variants, and historically many of those predate the linux tools that you are used to. Good questions though, and similar issues exist for those of us who use fink instead of ports. – dmckee Aug 1 '10 at 21:37
Your question would be better if it contained less editorializing. Crossing over from one Unix-like OS to another always brings surprises in the way different common Unix commands have followed different evolutionary paths on different platforms. I've used Solaris, DEC Ultrix, AT&T SysV, HP-UX, GNU/Linux (many distros), NEXTSTEP, OpenStep, BSDI, Xenix/SCO, FreeBSD, NetBSD, Mac OS X, and CygWin. If you let yourself get too accustomed to unique features of one flavor's tools, it's painful when you go to another favor. That doesn't make them "broken". – Spiff Aug 2 '10 at 7:24
Right, and don't forget Hurd. Other than Linux and OSX, the rest of your list is of historical interest only. – taw Aug 2 '10 at 16:05
@taw: Solaris is still in use in a lot of places, particularly for zfs. – Dan Dec 29 '15 at 23:32
up vote 13 down vote accepted

Many netstat features can be replaced with a lsof command. I was often using

netstat -lnp | grep 1234

to find out who was listening on port 1234. With lsof (that is available on both systems), I can do:

lsof -i :1234

The top command on OSX is not bad either, it's just different. And I'm quite sure some of the metrics only make sense on Mac.

share|improve this answer
OSX lsof is better better netstat than OSX netstat, thanks. – taw Aug 2 '10 at 15:56

Oh cool, htop is in Homebrew! I guess it isn't a clone of Linux top but if you decide to use htop on Linux then I guess htop on OS X won't be too far off.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.