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 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 on July 17, 2012.

Leo’s Tech Blog

A personal blog on tech stuff.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

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