Some OSX Command Line Stuff

Leo Soto
Leo Soto
Jul 17, 2012 · 1 min read

Posted by Leo Soto on July 17th, 2012.

A couple of neat tricks that I use from time to time:

  • $ mdfind: How could I be a Mac user for almost 3 years without knowing that you could use spotlight from the command line!?
  • $ purge: Flushes the disk cache. Usually, you don't mess with that stuff and just let do the OS to do its magic. Unfortunately, since installing Lion I sometimes see a huge performance degradation when many applications are being used at the same time. By running this command, after a brief pause everything returns to normal.
  • $ dnscacheutil -flushcache: I believe this is self-explanatory. Useful when useless information is obtained from a flaky proxy server and cached.
  • $ networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4: Use Google's Public DNS servers (see situation above)
  • $ networksetup -setdnsservers Wi-Fi empty: Go back to default DNS provided by DHCP.

Originally published at techblog.leosoto.com on July 17, 2012.

Leo’s Tech Blog

A personal blog on tech stuff.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store