68

On prior versions of OS X, it was possible to display hidden files in a Finder dialog box (Open, Save, etc.) using Command-Shift-Period.

In Mavericks, that feature isn't working for me. Is there another command that one can use? I would prefer not to globally enable hidden files.

EDIT: I'm the one offering the bounty. It seems I cannot comment because I don't have enough rep now :)

So... yes, I'm also running 10.9.1 and it does not work. I have used it in previous versions of OSX and it worked fine. The script mentioned is OK to show the hidden files in Finder, but it does not work that well when using the open/save dialog.

My use case: sometimes I need to open/save files to the /tmp directory. In previous versions of OSX I just used the dialog to get to the disk root, and then press CommandShift. and then I was able to see the /tmp directory (actually /private/tmp).

So, if you guys are using the same version of OSX and it does work for you, I guess there must be a way to re-activate this. Any ideas?

Cristian
  • 335
Boyd
  • 681
  • 1
  • 5
  • 3
  • 5
    I just tried Cmd-Shift-. in an Open... dialog (in Chrome on 10.9.1) and it worked great. Are you: 1) sure that the folder you're using the short cut in actually has hidden files in it (I used it in ~)?; 2) That Cmd-Shift-. hasn't been remapped to something else on your system? – Ian C. Dec 24 '13 at 23:38
  • 3
    This still works on my 10.9.1 – markhunte Dec 25 '13 at 00:11
  • @Cristian: My machine is currently not experiencing the issue you are having, so it's hard to replicate/resolve the issue for me; however, hopefully I can help you isolate what may be causing it. Is the user account you are using on your machine set up as an Admin account? Also, when was the last time you performed a Repair Permissions on the computer? – Anil Dec 31 '13 at 06:27
  • @Cristian and Boyd, I just wanted to clarify something. Does this issue occur in any open/save dialog box, basically is it application independent, or does it occur in only a finite number of applications. – Anil Jan 01 '14 at 19:55
  • 1
    i confirm that the old toggle shortcut stopped working for me too on 10.9.1. had to resort to globally showing all files always with defaults write -g AppleShowAllFiles -bool true – Viktor Trón Jan 14 '14 at 04:23

8 Answers8

60

The key bindings doesn't work in Column view mode on Maverick, but it works in e.g. List view mode. Switching back to Column view mode after doing the toggle in List view mode then shows the hidden files.

armando.sano
  • 1,009
  • 6
    This!! This is the answer! +1 thank you. I can't imagine what inspired them to disable it for column mode – Anentropic Feb 25 '14 at 16:15
  • @Anentropic: I am late in this discussion. I find your answer and works for me, I can see the hidden files but I cannot open them like I could in previous versions. Do you know how to open the hidden files? – Nrc Jun 16 '14 at 11:03
  • @Nrc if you are in a dialog box for opening a file it is likely the program you are using has specified only certain file types (i.e. file extensions) as suitable to open... hidden files are often unix files beginning with a period and so will be filtered out by most programs unless you select the 'all file types' option... maybe this is your issue? – Anentropic Jun 16 '14 at 12:01
  • +1 Thanks for the tip. But seriously... how stupid is this ? Why would the key combination work in one display mode and not the other ? Damn... – Pierre Henry Mar 19 '15 at 10:17
  • 3
    It isn't disabled, it's just buggy. After pressing Cmd + Shift + ., click to another folder then click back and you can see the hidden files, even in column mode. – Tamlyn Sep 13 '15 at 13:50
38

I'm currently running OS X (10.9.1) and just tried the + + . keyboard shortcut in a save dialog box and it worked just fine.

I've also setup an AppleScript on my machine with a keyboard shortcut of ^ + + + . which toggles the visibility of hidden files within Finder whenever I want. This way I don't have to manually run a terminal command to show hidden files, and I can quickly turn it off to avoid accidentally modifying system files. I use FastScripts (also available in the Mac App Store) to allow me to set the keyboard shortcut for my AppleScript, and placed the AppleScript in my ~/Library/Scripts Folder.

Update

I've updated my script so that Finder does not need to be killed every time you wish to show/hide the display of hidden files. As markhunte pointed out, you can toggle the view state of the Finder window which will refresh the listing of contents. Thanks markhunte for pointing that out to me! Here's the updated script:

(*
    Author: Anil Natha
    Description: 
        This script toggles the visibility of hidden files in OS X. This includes
        showing hidden files in Finder windows and on the desktop.
    Last Updated: 2015-02-20
*)
tell application "System Events"
try
    set hiddenFilesDisplayStatus to do shell script "defaults read com.apple.finder AppleShowAllFiles"
on error
    set hiddenFilesDisplayStatus to "NO"
end try
set hiddenFilesNewDisplayStatus to "NO"

if hiddenFilesDisplayStatus is "NO" then
    set hiddenFilesNewDisplayStatus to "YES"
end if

do shell script "defaults write com.apple.finder AppleShowAllFiles " & hiddenFilesNewDisplayStatus

end tell

tell application "Finder"

set allWindows to windows

repeat with currentWindow in allWindows
    set currentWindowView to get the current view of the currentWindow
    set alternateWindowView to list view
    if currentWindowView is list view then
        set alternateWindowView to icon view
    end if
    set the current view of the currentWindow to alternateWindowView
    set the current view of the currentWindow to currentWindowView
end repeat

end tell

Older version of the script is listed below. Although it works, I don't recommend using it any longer now that the above script works more efficiently.

tell application "System Events"
set hiddenFilesDisplayStatus to do shell script "defaults read com.apple.finder AppleShowAllFiles"
set hiddenFilesNewDisplayStatus to "NO"

if hiddenFilesDisplayStatus is "NO" then
    set hiddenFilesNewDisplayStatus to "YES"
end if

do shell script "defaults write com.apple.finder AppleShowAllFiles " & hiddenFilesNewDisplayStatus
do shell script "killall Finder"

end tell

Anil
  • 883
  • Thanks. Give the keyboard shortcut a try. I've been using it for a number of years and has come in handy numerous times. – Anil Dec 26 '13 at 03:25
  • 3
    Tried in 10.9.1. Seems to work but need to click out and into folder for it to update. Not very elegant, but effective. Thanks – Joop Dec 30 '13 at 10:47
  • That's odd that you have to click out and into the folder. Do you have to do that prior to or after you trigger the shortcut? In any case, for Finder to recognize the change, it has to be restarted, when that happens, I simply use the ⌘ + TAB key to get back to the Finder window if needed. – Anil Dec 30 '13 at 14:48
  • 2
    I have found in 10.9x the finder does not have to be restarted. you can just change the views to something else and back again see my answer here http://stackoverflow.com/a/21790997/261305 – markhunte Feb 28 '14 at 12:34
  • Thanks for the tip @markhunte. I didn't know about that workaround, and a good one too! Now I need to adjust my scripts so that it simply refreshes the view rather than killing Finder. Thanks again. – Anil Mar 05 '14 at 19:52
  • I bound the original keyboard shortcut ⌘ + ⇧ + . to this script with Better Touch Tool. Works like a charm. – Nick Woodhams Feb 13 '15 at 02:11
  • @NickWoodhams, that's awesome, glad to hear this worked for you and so many others. I've trying for some time now to figure out how to update my script so that it doesn't have to kill finder, but instead simply refresh the screen by toggling views as markhunte mentioned. Haven't had luck with that update, but if I figure it out, I'll be sure to post the updated script. – Anil Feb 13 '15 at 15:39
  • Thanks @markhunte, I've updated my script so that Finder no longer needs to be killed every time you toggle the visibility of hidden files. – Anil Feb 20 '15 at 21:18
  • It appears that the shortcut doesn't work in Yosemite. Is there an alternate shortcut? – wst Apr 08 '15 at 21:04
  • @wst Which shortcut doesn't work? The custom one I created? – Anil Apr 09 '15 at 03:38
  • @SlyRaskal Sorry, no, it's the ⌘ + ⇧ + . shortcut that doesn't seem to work in 10.10. – wst Apr 09 '15 at 14:24
  • I get the error: The domain/default pair of (/Users/UserName/Library/Preferences/com.apple.finder, AppleShowAllFiles) does not exist" – Jeff Lockhart Apr 24 '15 at 23:05
  • To work around this error, because the key AppleShowAllFiles doesn't exist by default, the line set hiddenFilesDisplayStatus to do shell script "defaults read com.apple.finder AppleShowAllFiles" should be enclosed by a try block and hiddenFilesDisplayStatus set to a default of "NO" in that case. – Jeff Lockhart Apr 24 '15 at 23:22
  • I added the edit to your script. – Jeff Lockhart Apr 24 '15 at 23:26
  • @JeffLockhart, thanks for the info! In your test, was the value for the key AppleShowAllFiles set properly after the check for the key determined the key didn't exist? Just want to ensure the key is set properly in subsequent calls to the script. – Anil Apr 24 '15 at 23:46
  • @SlyRaskal yes, I tested the script with my edit and it works as expected. The first time it's run, the key isn't found, so it defaults the variable to false and then enables showing hidden files. On subsequent runs, the key now exists, so it toggles it as expected. – Jeff Lockhart Apr 24 '15 at 23:50
  • @JeffLockhart, awesome! Thanks for the input and edit. – Anil Apr 24 '15 at 23:51
  • @JeffLockhart, shouldn't the hiddenFilesDisplayStatus flag be set to YES when the AppleShowAllFiles key doesn't exist because OS X doesn't show hidden files by default? – Anil Apr 24 '15 at 23:57
  • @SlyRaskal hidden files are not shown by default, which is why when the key does not exist, it is as if the key was equal to false. The value is then toggled and set to true in the following lines. So this is the correct behavior as I have it. – Jeff Lockhart Apr 24 '15 at 23:58
  • To test the behavior, you can run defaults delete com.apple.finder AppleShowAllFiles to remove the key and return it to it's default state, then test the behavior of the script. – Jeff Lockhart Apr 25 '15 at 00:00
  • @markhunte I am trying this via ScriptEditor and the method of updating the view without killing Finder doesn't work (using El Capitan). Tried it even manually, running the script with the first "tell block" (not sure with the terminology here). – Chris Nov 27 '15 at 13:14
3

Never knew that that feature existed. But then, I've always used a different way, one that still works in 10.9:

The system extension Default Folder X. It's an old goodie, and still working well.

One of its Advanced options is to hold down Option when choosing Open/Save etc. to show all files, including the hidden ones.

Thecafremo
  • 13,617
  • 3
  • 45
  • 48
2

It does still work, but it was buggy for me.

I had to change directories and then return to the first folder. Then it displayed hidden files.

It doesn't help to close/reopen the dialog. I'm not sure how widespread the bug is or what the trigger could be (this laptop is less than 48 hours out of the box).

1

The shortcut ⌘⇧. still works fine for me in Mavericks. It doesn't seem to have been changed since previous versions of OS X.

Some things you can try…

  • Make sure that the folder you're looking at has hidden files/folders.

    • You can use ls in Terminal to see if there are hidden files/folders:

      cd /path/to/folder && ls -la
      
  • Make sure you've not remapped the shortcut to something else.

    • Check System PreferencesKeyboardShortcuts for any mappings to ⌘⇧.
    • Check any 3rd party apps for mappings to ⌘⇧.
grg
  • 201,078
0

As many others said, it still works perfectly fine. Maybe you changed a shortcut to this and that masks your intended task which is to show the hidden files.

NEO
  • 706
0

This is not a solution to a hot-key but I will share what I use for this task. Funter app

JW_
  • 522
  • 2
  • 6
  • 14
-1

You can turn it on by default doing this Terminal command:

defaults write com.apple.finder AppleShowAllFiles -boolean true
killall Finder

...but this is less than convenient compared to a keyboard shortcut... but you could create an Automator workflow which runs a service which runs a Terminal command all assigned to a System Preferences Keyboard Shortcut... but still not as convenient.

JBRWilkinson
  • 1,905