How can I show hidden files/folders in Finder

10

2

How can I see the hidden files in Finder?

For instance, if I have a file named: .something is is not listed.

Right now I have to open the terminal and type ls -la.

OscarRyz

Posted 2009-10-09T17:19:44.457

Reputation: 3 691

You can use this keyboard shortcut. It works for me on Lion, though YMMV. It's especially handy for "Open File..." dialogs produced by applications like browsers because I've found these do not observe the defaults write com.apple.finder AppleShowAllFiles True flag.

– chb – 2012-03-14T08:37:18.440

Answers

7

Open a Terminal and enter:

defaults write com.apple.finder AppleShowAllFiles TRUE

Then, relaunch Finder by typing:

killall Finder

To reverse that, just enter:

defaults write com.apple.finder AppleShowAllFiles FALSE

Bryan Schuetz

Posted 2009-10-09T17:19:44.457

Reputation: 1 494

3

The better way I found is using an Automator service. So I can toggle directly from Finder menu without needing to launch an App

Toggling hidden files

Toggling Hidden Files:

To install just unzip, double click the file, you will be asked to install it, just click Install and then click Done.

Control+Click or Right-Click > Open

Vitim.us

Posted 2009-10-09T17:19:44.457

Reputation: 313

The link doesn't work for me, and you don't explain HOW to add it to the Services Menu. Can you edit your question to include the information? – Canadian Luke – 2012-10-20T18:55:00.147

This service/app are essentially Run AppleScript Automator actions that wrap the defaults and killall calls in a dialog-driven ("Do you want to relaunch Finder?") workflow. – Daniel Beck – 2012-10-20T21:01:56.067

2

You can use this script toggle between states:

# check if hidden files are visible and store result in a variable
isVisible=”$(defaults read com.apple.finder AppleShowAllFiles)”

# toggle visibility based on variables value
if [ "$isVisible" = FALSE ]
then
defaults write com.apple.finder AppleShowAllFiles TRUE
else
defaults write com.apple.finder AppleShowAllFiles FALSE
fi

# force changes by restarting Finder
killall Finder

You can also download an Automator application which will toggle hidden file visibility here:

http://www.brooksandrus.com/downloads/show_files.zip

Antonio

Posted 2009-10-09T17:19:44.457

Reputation: 597

1With Mavericks, the default value is apparently 0; 0 and 1 work as values as well as TRUE, true, FALSE, false, yes, and no. So it is indeed the condition in the if statement that is the problem here. I'd rather use case here for the multiple possible values. – JyrgenN – 2014-08-21T07:25:43.157

It doesn't work on Mavericks. – Dmitry – 2013-10-28T08:00:24.990

for Mavericks use com.apple.Finder instead of com.apple.finder – Antonio – 2013-10-28T12:21:35.193

It doesn't work too. Something wrong on if section. – Dmitry – 2013-10-28T12:51:58.737

1

You can also create alias for this to something that you can remember. Just add the following into your .bash_login:

alias show_hidden_files='defaults write com.apple.finder AppleShowAllFiles TRUE && killall Finder';

alias hide_hidden_files='defaults write com.apple.finder AppleShowAllFiles FALSE && killall Finder';

Hadi Sim

Posted 2009-10-09T17:19:44.457

Reputation: 11

0

Save this applescript into a service to make it available from the Finder menu. It will allow you to toggle hidden files on or off and when you relaunch Finder it will reopen to the directory you were previously in:

tell application "Finder"
    set windowTargets to target of Finder windows
    quit
end tell

set OnOff to do shell script "defaults read com.apple.finder AppleShowAllFiles"
    if OnOff = "NO" or OnOff = "OFF" then
        set OnOffCommand to "defaults write com.apple.finder AppleShowAllFiles ON"
    else
        set OnOffCommand to "defaults write com.apple.finder AppleShowAllFiles OFF"
    end if

    do shell script OnOffCommand
    delay 1

    tell application "Finder" to launch
    tell application "Finder"

    repeat with aTarget in windowTargets
        make new Finder window at aTarget
    end repeat
end tell

davidcondrey

Posted 2009-10-09T17:19:44.457

Reputation: 1 345