Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the quickest way to toggle hide/show hidden files on a Mac OS X Yosemite?

Tags:

I'm on Yosemite, and I want to toggle hide/show all the hidden files on a Mac.

Every-time, I want to do that I have to go to Terminal.app and run these command :

To show

defaults write com.apple.finder AppleShowAllFiles TRUE

To hide

defaults write com.apple.finder AppleShowAllFiles FALSE

I'm wondering if there is a better tweak out there that accomplish this in just a click of a button.

like image 785
iori Avatar asked Mar 19 '15 01:03

iori


People also ask

What is the shortcut to hide hidden files on Mac?

Locate the files you want to hide. For easy access to these files, use the Finder feature on your Mac. Simultaneously, press Shift+CMD+Period (.) to hide the files. This procedure will not only hide your files, but it is also helpful when you want to access hidden files.

How do I toggle hidden files on Mac?

Showing hidden files via Mac Finder Open the folder where you want to search for hidden files. Press the “Command” + “Shift” + “.” (period) keys at the same time. The hidden files will show up as translucent in the folder.

How do I show hidden files and hide them?

Select the Start button, then select Control Panel > Appearance and Personalization. Select Folder Options, then select the View tab. Under Advanced settings, select Show hidden files, folders, and drives, and then select OK.


2 Answers

I prefer using this shortcut:

⌘ CMD+⇧ SHIFT+.

like image 159
Hannes Tiltmann Avatar answered Sep 27 '22 21:09

Hannes Tiltmann


Update, considering all comments:

try
    set state to (do shell script "defaults read com.apple.finder AppleShowAllFiles") as boolean
on error
    set state to false
end try

do shell script "defaults write com.apple.finder AppleShowAllFiles " & (not state)

try
    tell application "Finder"
        set w to front window
        set t to (get target of w)
        if t is not startup disk then
            set the target of w to startup disk
        else
            set the target of w to home
        end if
        set the target of w to t
    end tell
end try

tell application (path to frontmost application as text)
    display notification "ShowAllFiles is now " & (not state)
end tell

Export the script as app and cmd-drag the app to the Finder window toolbar.

like image 40
user309603 Avatar answered Sep 27 '22 20:09

user309603