Show hidden files

Hello everybody,


Simple task. I would like to see hidden files & folders on my drive.


I have been using code like this:

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


It worked fine when I was using OS X 10.6.8.
Today I upgraded OS to 10.10 Yosemite and this code does not work.


I searched over the internet, even tried every combination that came across my eyes, but non of it worked.

Does anybody know how to do this on Yosemite?


Thanks for your help.

MacBook Pro, OS X Yosemite (10.10)

Posted on Oct 18, 2014 6:23 AM

Reply
16 replies

Oct 18, 2014 7:13 AM in response to TotalGym

What I observe in Yosemite, is that I have two different Bash scripts,and one AppleScript that work to toggle the hidden files, but if you copy/paste the identical defaults syntax from these scripts in the Terminal, it is ignored. A new Terminal session does not remedy this issue.


The syntax that I use matches yours, with the exception of -bool, and TRUE/FALSE usage. No variation of true/false appears to work in the Terminal. On Mavericks 10.9.5, with the patched Bash shell (v3.2.53(1) - same as Yosemite, these commands work just fine in the Terminal.


Here is some properly attributed AppleScript that you open in Script Editor, save as text (.AppleScript) to preserve the source, and then option + Save As… to an application (without app extension), and place in your Dock. Each time you click it, there is a transition from hidden to unhidden files. Called mine dothide.


This works equally well on Yosemite.


-- Submitted by Baltwo on Apple Support Community


try

do shell script "defaults read com.apple.finder AppleShowAllFiles"

on error

do shell script "defaults write com.apple.finder AppleShowAllFiles 0"

end try


if (do shell script "defaults read com.apple.finder AppleShowAllFiles") is equal to "0" then

do shell script "defaults write com.apple.finder AppleShowAllFiles 1"

else

do shell script "defaults write com.apple.finder AppleShowAllFiles 0"

end if


do shell script "killall Finder"

Oct 18, 2014 9:13 AM in response to VikingOSX

Thank you very much for your response.


I made the script based on your instructions and it does not work for me.
Each time I run the script, I check the value in Terminal with this line:

defaults read com.apple.finder AppleShowAllFiles


- Before script the result is 0.

- I run the script, after a while the result is 1.
- Then Finder is being restarted.

- But when Finder restarts the result is 0 again and it does not show hidden files.


Do you have any suggestions?

Jan 2, 2015 9:43 PM in response to VikingOSX

🙂

I have no idea what all this is. I found Terminal, pasted "defaults read com.apple.finder AppleShowAllFiles" but it sure isn't giving me what I want!


Yesterday I saved some documents in Pages starting with a . because I like the way the documents are arranged numerically when I use a dot. I didn't realize I wouldn't be able to access the documents later. I saw the warning where it said that . files are "reserved for the system" but didn't read it to the end where it says that the documents will be hidden!


Well, will someone please tell me how to get to those documents so I can change the file names? I can use a - instead of a .


🙂

Jan 3, 2015 2:05 PM in response to troysantos

I tried cutting and pasting the given command combination, but to no avail. However I have noticed that my mac ( I am a recent user of the Mac) is often quite slow at doing some things. So I ran the first part: "defaults write com.apple.finder AppleShowAllFiles 0" then left it for about 30 secs/1min then I ran the kill: "killall Finder" .


This appeared to work! Looks like Finder is being restarted before the defaults change has had time to be reset.

At least that is my interpretation!

azdflora

Jan 6, 2015 8:17 AM in response to TotalGym

I believe that the problem is as simple as capitalizing "true" in the Terminal command:

defaults write com.apple.finder AppleShowAllFiles TRUE

Case matters here. This works from 10.8 onward. I just tested it on 10.10, and it worked there too, even after a logout/login.


Charles


P.S.: Reading through the other responses, I see that at least one other person tried all variations of "true." Well, it works for me. Perhaps this was broken and fixed in 10.10.1?

Jan 7, 2015 8:00 AM in response to troysantos

Another thing you can do in Terminal, even if you never get the hidden files to appear, is to rename your files. In the Finder, find the folder that the files are in but don't open it, then in the Terminal type cd and space and then drag the folder into the Terminal window and then hit return. That will put you in that folder. Then type


ls -a


and return, which will give you a list of all files in that folder, including the hidden files. Once you have that list, you can just change the file names. Example, for a file named .file name:


mv ".file name" "file name"


The quotes are to make things easier if you have spaces in your file name. If the files don't have spaces, then


mv .file file


will suffice. Hit return after every command, of course.

Sep 3, 2015 6:52 PM in response to TotalGym

Thanks VikingOSX for the script!


"option + Save As… to an application (without app extension), and place in your Dock"


However I had an issue with the above instructions. On my system 10.10.5, I couldn't place the script file without the '.app' extension on to the dock. Which kind of makes sense.


Don't remove the .app extension. It works fine now.


Cheers

Sep 28, 2015 4:18 PM in response to TotalGym

For those of us afflicted with terminal phobia, just do a search for "hiddenfiles widget" and install it in the dashboard. Iʻm running Yosemite 10.10.5 and it works like a charm. I am sure it executes the same terminal script referenced in other responses here. I downloaded my own copy from Softpedia, but noticed that it is available as a free download at a number of Mac sites.

Nov 16, 2015 2:52 PM in response to azdflora

Thank you very much this worked fine.


Opened Terminal

copied your line command - defaults write com.apple.finder AppleShowAllFiles 0 - into Terminal and hit Return key

waited 30 seconds

copied your line command - killall Finder - into Terminal and hit Return key


The screen flashed and I was then able to open Finder and see the hidden file I needed to delete.


I then entered the line command - defaults write com.apple.finder AppleShowAllFiles 1 - into Terminal and hit Return key

waited 30 seconds

copied your line command - killall Finder - into Terminal and hit Return key

The screen flashed and the hidden files where hidden again.

Closed Terminal

Problem solved 🙂

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Show hidden files

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.