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

7

26

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.

Pollaiuolo answered 19/3, 2015 at 1:46 Comment(2)
The answer from @user309603 worked perfectly for me in Yosemite.Ruberta
You can also browse hidden files/folders on local storage in OS X using the FTP app Transmit. (On the View-menu in Transmit you can choose to show hidden files.) A quick solution for those who don't like using the Terminal.appBenavides
A
67

I prefer using this shortcut:

⌘ CMD+⇧ SHIFT+.

Ariminum answered 9/5, 2017 at 15:44 Comment(4)
This is great. I was always using custom function in shell to control show/hide. Now I could ditch those functions and use this shortcut!Illegal
Does not seem to work on osx 10.8, is there another command to replace it?Retarded
Nice!! Worked here on macOS Mojave v10.14!!Gerik
Ahhh.. this is what I was missing last 5 years 😩 thanks 🙏🙏Curr
D
4

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.

Discretion answered 19/3, 2015 at 10:3 Comment(3)
These are really good news. I've been using this script for years and didn't noticed the change. Thanks for the hint.Discretion
If you want to use this script with just one click, save it as an app and cmd-drag it to the toolbar of a Finder window. It's fast accessible in every window then!Assibilate
How to "save it as an app": 1. Open ScriptEditor application. 2. Paste in the above script. 3. Select File :: Export (enter filename, select File Format = "application" and making it "Run Only")Ruberta
B
4
  • Open finder.
  • Hold down Cmd + Shift + . (dot)

And all your hidden files are visible.

Hold down Cmd + Shift + . (dot) to revert to original.

Bouleversement answered 2/7, 2018 at 4:29 Comment(0)
D
2

I came across another solution by using Automator.

Open Automator Select Services Select Utilities -> Run Shell Script (drag it into the window on the right)

Top bar above code window. Service receives: no input in Finder

Add the following code to show hidden files

status=`defaults read com.apple.finder AppleShowAllFiles`
if [ $status == true ];
then
defaults write com.apple.finder AppleShowAllFiles false
else 
defaults write com.apple.finder AppleShowAllFiles true
fi
killall Finder

Save the script.

Make a shortcut Go to System Preferences -> Keyboard -> Shortcuts -> Services and find the Services you made showing hidden files. There might be a shortcut there if so test it out. If there is not shortcut there then add shift+cmd+. (period) as the shortcut.

To show hidden files use the shortcut: shift+cmd+. (period). To hide the files use the same shortcut again.

OR click the desktop and go to in the top menu: Finder -> Services -> name of file to show hidden files. First time to show the files and second time to hide them.

To delete Services scripts. Go to your hard drive -> user name -> Library -> Services -> and there you will see the Services Automator scripts.

Resources used: https://discussions.apple.com/message/29357134#29357134

How to delete Automator services. https://www.youtube.com/watch?v=kaVHwhau1M4

Here is a tutorial that I made: https://www.easywebdesigntutorials.com/easily-show-hide-hidden-files-on-the-mac/

Discursion answered 24/11, 2015 at 7:50 Comment(0)
S
1

Change "killall Finder" to "KillAll Finder" in user309603's script, save it as an applet somewhere, and it should work. That means that you can just write "ToggleVisible" or something in Spotlight, and it will do the changes.

I'd also wrap the alert box into a tell application (path to frontmost application as text) block, to ensure that it won't get lost.

Sprint answered 19/3, 2015 at 13:39 Comment(0)
A
1

If you are french and got an azerty keyboard you have to add the fn key presse cmd + fn + maj + ; and you are good to go

Adduction answered 21/7, 2020 at 13:41 Comment(0)
A
0

You can even download 'Secrets' preference pane, which gets installed in System Preferences. Hidden settings can be enabled/disabled. https://code.google.com/p/blacktree-secrets/downloads/list

Abundant answered 24/3, 2015 at 11:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.