Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

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

What is Ubuntu's CTRL+H equivalent in OSX Lion Finder to toggle display hidden files?

My all searches point me to use: defaults write AppleShowAllFiles TRUE which is not exactly the same and its effect is somewhat permanent.

share|improve this question
up vote 15 down vote accepted

⇧⌘. shows hidden files in file dialogs and in some third party applications like TotalFinder. Transmit also has a menu item for toggling hidden files, but it's assigned to ⇧⌘B by default.

There's nothing equivalent to that in Finder though. But you could assign a shortcut to a script like this with FastScripts or by creating an Automator service.

k=" AppleShowAllFiles"
[[ "$(defaults read $k)" == 0 ]] && b=true || b=false
defaults write $k -bool $b
osascript -e 'quit app "Finder"' && open -a Finder

share|improve this answer
taking this one step further... add a service to show/hide hidden files from an Automator workflow. see – libjack Dec 1 '11 at 21:23
@libjack I edited the answer to add instructions for creating an Automator service as well. – user495470 Dec 1 '11 at 23:09
This does not work on Mountain Lion! Any ideas why? – Mohamad Oct 10 '12 at 16:42
@Mohamad The activate event seemed to time out part of the time. I replaced it with a shell script. – user495470 Oct 10 '12 at 20:39
Thanks. I'll try this out and report back if I have any issues! – Mohamad Oct 10 '12 at 20:59

defaults write AppleShowAllFiles FALSE reverse it. And there is no such functionality (online hide/show without restart) built in into Finder.

That is probaly because anyone who need it will prefer ls -a anyway.) BTW If you only need to list hidden files use ls -ld .??*

share|improve this answer
+1 for that funny command that I've never seen before .??* – gentmatt Nov 30 '11 at 20:40
@Matt I am myself a bit of terminal monkey because I'm using many of commands and arguments without full understanding but rather found them as they are when they were needed and keep on using them in their original form =) Your comment prompted me to look into this arguments when I have a bit more time though (I wonder why there are two ?? and then wild card too) but for now it works for me). But if you can give me a link plainly explaining arguments for unix commands that would be sweet) – iskra Nov 30 '11 at 21:45
well as far as i understand .??* would search for files starting with a . and at least two characters in the name. You could use .* as well to list all hidden files. But that's not the point. I was looking to show/hide files in the finder without switching to terminal each time. You would know this if you have tried poor/free ubuntu :) – kunal Dec 1 '11 at 19:39
a slightly better (but harder to type) pattern would be .[^.]* -- forces the second character to be anything except for dot – libjack Dec 1 '11 at 21:26

You could buy TotalFinder. It is a finder replacement that supports this feature (and many other nice features like tabs). TotalFinder features the . shortcut as seen here:

Hidden Files Example

See more details about this particular feature on their site

share|improve this answer

Wow, the above sounds really complex, why not open a terminal, and

  • type defaults write AppleShowAllFiles YES and press return
  • Now Ctrl-Opt-Click on the Finder icon and select Relaunch

To un-hide run defaults write AppleShowAllFiles NO the same way.

share|improve this answer
It's a bit more work to setup but much easier to use afterwards, especially if you are not using a lot. – patrix Jun 24 '12 at 17:15

Here's a tutorial for setting up a contextual menu item to toggle visibility of hidden files.

Still not as good as a keyboard shortcut. Filing a duplicate of radar://7096650 at is the best way to tell Apple that you want this feature.

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.