Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to see all hidden files on my Mac except .DS_Store. Is there a way to do that?

share|improve this question

9 Answers 9

up vote 12 down vote accepted

You can show hidden files in Finder with a simple Terminal command:

defaults write com.apple.finder AppleShowAllFiles -bool YES

Then relaunch Finder by holding down the option key and right-clicking its dock icon.

However, you can't hide the .DS_Store files without hiding the rest of the hidden files. You probably just have to live one way or the other.

share|improve this answer
2  
It doesn't work any more on Mac OS X 10.9 Mavericks:( –  Altaveron Oct 28 '13 at 7:26
    
@Altaveron - Just change YES to TRUE, ie. sudo defaults write com.apple.finder AppleShowAllFiles TRUE –  CourtDemone Nov 13 '13 at 20:52
    
Doesn't help but because of issue with if section before the code. –  Altaveron Nov 14 '13 at 0:22
    
just confirming from os x 10.10 Yosemite this still works.. with YES/NO. –  gorelative Jun 10 at 20:07

This is what Adobe suggests:

To avoid creating .DS_Store files, do not to use the OS X Finder to view folders. An alternative way to view folders is to use UNIX command line.

Brilliant! ;)

share|improve this answer
11  
Those Adobe folks are always so helpful. –  Alan Jul 12 '10 at 15:34
1  
How does this help with the Desktop issue? You will always be looking at the Desktop through Finder... Right? –  rcd May 25 at 17:07
    
im sorry but i dont understand how this is such a highly upvoted answer. "in order to not get .ds_store, don't use a critical piece of your os" –  gorelative Jun 10 at 20:07
    
@gorelative You may find an explanation here –  Pumbaa80 Jun 10 at 23:47

You can't hide it, but you can make it transparent, then drag it to the bottom-left or bottom right corner. So only you will see a string ".DS_Store", and there will be no icon.

Expert method: Copy a transparent image from your favorite img editor, select the icon of the file in the file info window, and paste the transparent image when the original icon is selected on the top.

Step-By-Step method:

  • Find a pure-white area in a folder, then press Shift-Command-Control-4, and drag out a square. Release the mouse when done, and the white area is now on your clipboard.
  • Open Preview and press Command-V.
  • Click and hold on the Select button in Preview's toolbar, and Instant Alpha from the drop-down menu.
  • Click and drag across the white area until you see the displayed value reach 100%, then press Return.
  • Copy the selected area (Command-C).
  • On the desktop, select your new folder and press Command-I (File » Get Info).
  • (Press Tab once in the Get Info window to) highlight the default icon.
  • Paste the transparent icon from your clipboard into the default icon (Command-V).
share|improve this answer
1  
Not useful in list view, column view, or when keeping items sorted. Also requires changes to every directory's layout. –  Daniel Beck Jan 14 '12 at 23:49
    
Works perfect if desktop is all you care about (like me). Also, if you use the pattern of the desktop instead of transparency then you can push the text out of sight - making the entire icon disappear without a trace. –  bendytree Jul 19 '12 at 14:05
    
For me too, it was a desktop annoyance… –  Robert C Edwards Oct 23 '13 at 18:27
    
Good method. Though, it seems temporary sometimes (at least in Mavericks); I see it often change back to an image icon (e.g., PNG or whatever the original format for the transparent image was). –  rcd May 25 at 17:06

I found that peace of open source magic: asepsis. Sources are available on Github but note that this is currently not compatible with OS X Mavericks (version 10.9)

From the FAQ:

Asepsis 1.3 does not work with 10.9. (the installer refuses to install). I'm looking for some solution and I will update you on Asepsis progress in some future blog post.

From the "Fix 10.9 compatibility" issue on Github

Current implementation is not possible under Mavs. They check all dynamically loaded libraries for apple code signature. We would have to "jailbreak" dynamic library loader, which would be a bad thing.

At least, this seems to be the best solution for previous versions of osx. Maybe someone will find a solution in the future.

UPDATE: Version 1.4 now works with OS X Mavericks.

share|improve this answer
1  
This seems like a good app. However the one issue I did note was that if you move entire folders, the matching DS_Store files will not be updated (something about this functionality being not possible due to the indexing design); this could lead to less-than-ideal indexing results. –  rcd May 25 at 17:09

After many on/off years of searching for a solution, there are only a few alternatives, none of which quite match your original question; i.e. no solution exists to your specific question....yet

  1. One can specifically disable the .DS_store files from being created at all
  2. Leave Finder configured to not display hidden files
  3. Follow Adobe's nonsense and only browse folders with a command line shell
  4. Toggle hidden folders on-demand. Check out this old wigit:

http://mac.softpedia.com/get/Dashboard-Widgets/Webcams/Miscellaneous/Hiddenfiles-Widget.shtml

share|improve this answer

Create an AppleScript/terminal service using Automator and save it to be accessible from the Finder>Services menu

The Automator action will be a two step process.

Step 1. Add an AppleScript. This script will toggle hidden files on or off (may not be properly formatted because I'm typing on my phone)

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

Step 2. Add a bash cron script. This additional script will automatically search for and remove any .DS_Store files at the same time they would be triggered to display. Once completed it will relaunch Finder and close the terminal.

#!/bin/sh
find ~ -name .DS_Store -exec /bin/rm -f -- {} \;`
KillAll Finder
exit 0

This is not a perfect solution but it will achieve the result your looking for.

Alternatively, you could use this utility which will redirect the creation of DS_Store files to a cache directory but I prefer not to install software that will consume resources whenever possible.

The link is http://asepsis.binaryage.com/

share|improve this answer
    
To prevent DS_Store files from being created on network volumes run this in terminal for each user on your computer. defaults write com.apple.desktopservices DSDontWriteNetworkStores true –  dcc Jan 20 at 4:07

Using Terminal works to hide DS_store files.

defaults write com.apple.finder AppleShowAllFiles -bool NO

this hide the hidden files. Can change no to yes if you wish to see them again.

share|improve this answer

just adding my solution to this as i didnt like any of the other options. I am web developer and I use /bin/zsh and oh-my-zsh .. either way you can add this to bash or sh..

Its simple, straight forward, and only 8 lines. I work a lot in the terminal though, so this is why this works best for my setup.

in my .zshrc i added the following lines to make switching easier.

function hideallfiles(){
    defaults write com.apple.finder AppleShowAllFiles -bool NO
    killall Finder
}
function showallfiles(){
    defaults write com.apple.finder AppleShowAllFiles -bool YES
    killall Finder
}

then run . ~/.zshrc or for bash . ~/.bash_profile or logout of your mac, and back in.

then in terminal you can run showallfiles or hideallfiles and it'll change the config and restart finder.

edit: confirmed working on 10.10 Yosemite

share|improve this answer

I'm using Xtra Finder (http://www.trankynam.com/xtrafinder) to toogle fast between hidden files. You can create your own shortcut for toogling. No need to kill finder. This is a little bit more handy and easier to use instead of typing commands or executing scripts.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.