28

To see my /etc folder I've tried this command in Terminal:

sudo chflags nohidden /etc

followed by:

sudo defaults write com.apple.Finder AppleShowAllFiles true; killall Finder

also tried:

sudo defaults write com.apple.Finder AppleShowAllFiles YES; killall Finder

Neither of them seemed to work.

4
  • What happens if you do xattr -d com.apple.FinderInfo /etc? (In addition to the nohidden flag you already set) Oct 24, 2018 at 14:56
  • Good question Martijn. It seems Apple sneakily revoked the chflags controlling power. Did you find the answer how to make chflags work?
    – Alma Alma
    Dec 28, 2018 at 6:16
  • 1
    Sadly no but the UI solution worked for me. Dec 29, 2018 at 16:41
  • By using sudo in the commands listed above, you are setting the preferences for the root user and only the root user. Unless you are logged into the GUI as root (not a good idea), they will have no effect on the currently logged in user.
    – NSGod
    Sep 5, 2021 at 20:16

2 Answers 2

51
+50

Session

This keystroke toggles between show & hide the hidden files:

Cmd ⌘ Shift ⇧ . (that’s a FULL STOP, period character)

Press again to toggle back and forth.

When you reboot your Mac, the hidden files will be hidden. Press the keystroke again to show.

Persistent

In Terminal.app, paste:

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

This changes the default setting to show hidden files. And this causes the Finder to restart, so you can see the effect. This new setting persists even after rebooting your Mac.

To revert to hiding again the hidden files, change that true to a false and run again in Terminal.

1
  • 2
    Wow, I knew that shortcut worked in open and save dialogs, but didn't know they added it to the Finder as well.
    – NSGod
    Sep 5, 2021 at 20:36
1

I would go about this a little differently. This assumes you want hidden files to always be shown everywhere (in the Finder and also in application's open and save panels).

First, I usually try to avoid killing apps and prefer to tell them to quit. While that is possible using AppleScript in Script Editor, this one-liner will help to solve this problem by adding a Quit menu item to the Finder:

defaults write com.apple.finder QuitMenuItem 1; killall Finder

To undo that you can use either:

defaults delete com.apple.finder QuitMenuItem

or:

defaults write com.apple.finder QuitMenuItem 0

This will now allow you to quit the Finder like any other app.

Second, to show hidden files for all apps (including the Finder), you set the AppleShowAllFiles setting in the global domain.

defaults write -g AppleShowAllFiles 1

To have those settings take effect, quit and relaunch the application you were using (including the Finder).

If you'd like to undo that, run either of the following:

defaults delete -g AppleShowAllFiles

or:

defaults write -g AppleShowAllFiles 0
1
  • You can quit, instead of kill, an application from the terminal with one of these: osascript -e ‘tell app “App Name” to quit’ or killall -QUIT -i applicationname
    – juandesant
    Sep 9, 2021 at 11:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .