Free version available
Magnifying Glass

The PocketSmith Blog

Syndicated Posts

FaceBook

Twitter

  • #financialconfession of the day: "I get really annoyed when my friends spend frivolously and then complain about... http://fb.me/I1qhJW4p 1 week ago
  • "Bye Bye Quicken Online, Hello Mint!" by Jay Monee on Budgets Are Sexy - "PocketSmith: This big pull with these... http://fb.me/EuooR2LH 1 week ago
  • "Too many people spend money they haven't earned, to buy things they don't want, to impress people they don't like." Will Smith #quote 1 week ago
  • More updates...

Show / hide system and hidden files quickly in Mac OS X

Monday, February 9th, 2009 by James

Although there are an inordinate number of applications that allow you to show and hide the hidden and system files in OS X, it has always felt a little bloaty to me. I did use XMod (http://www.geekpeaksoftware.com/xMod.html) for sometime, however I didn’t like that I had a whole host of functions I never use to just show / hide hidden files – and it takes four clicks to do so once you are even in the app. Fussy I know.

I have just stumbled across this nugget here – which lists the command to show and hide files, with the commands etc.

So what I’m doing here is using these commands to make a little terminal command that quickly shows and hides the files, instead of having to remember / look / copy + paste the command, or clicking like a maniac in XMod. If you are not comfortable using Terminal, just grab XMod above :D

  1. Open up Terminal
  2. Enter the following to edit your bash profile
    nano ~/.bash_profile
  3. Copy and paste the following three lines in at the end – make sure they are on separate lines. You will need to keyboard navigate arrows etc (just in case you aren’t familiar with nano)
    alias show_hf="defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder"
    alias hide_hf="defaults write com.apple.finder AppleShowAllFiles FALSE;
    killall Finder"
  4. Save the file (WriteOut – control (not command) + O) and exit (control + X)
  5. Enter the following into the Terminal to reload your bash profile:
    source ~/.bash_profile

You can now open your terminal, and enter the following to show all files quickly:

show_hf

And then to re-hide them:

hide_hf

Of course you can name these aliases anything you want.

Now, this post is not without a disclaimer – the above could be done much more elegantly I’m sure. I tinkered with setting it up as an Automator script so that we could have a little icon in the dock to click on. However I didn’t Google enough to figure out how to test what the current setting for AppleShowAllFiles is, and Terminal works well enough for me. If you have any insights let me know in the comments :D

Tags: , ,

3 Responses to “Show / hide system and hidden files quickly in Mac OS X”

  1. Mike says:

    Hey James, maybe try AppleScript? I’ve never used it myself, but I’ve read a bit about it, and I’m sure I remember hearing that it can run terminal commands. That way you can save it as a file just like Automator would.

    In fact having done a wee search, check this out: http://www.macosxhints.com/article.php?story=2004120314311760

  2. Arthur Gunn says:

    Elegant solution: applescripts launchable from finder window toolbars:
    http://gunn.co.nz/scripts.zip

    Also included an open in textmate one.

  3. James says:

    @Mike – yeah I had an initial tinker with AppleScript, but got frustrated and just went for the dirty terminal version ;)

    @Athur – thanks bro, those are awesome! The toggle one is sitting in my Dock now!

Leave a Reply