How to hide DS_Store Files?

Discussion in 'OS X El Capitan (10.11)' started by schwine1, Jun 5, 2016.

  1. schwine1, Jun 5, 2016
    Last edited by a moderator: Jun 6, 2016

    schwine1 macrumors regular

    Joined:
    Sep 13, 2008
    #1
    How can I hide or make invisible DS_Store files within folders on Mac OS X El Capitan (version 10.11.5)?
    I've tried copy and pasting the script below in Terminal, and the DS_Store files are still visible.

    Note that the DS_Store files in question are recovered files from a damaged hard disk that are now on my main Mac computer (Mac Mini, 2014). The folders in the recovered files have the visible DS_Store files, whereas all other folders on the Mac Mini do not have "visible" DS_Store files.

    Thanks for any tips on how to make DS_Store files invisible in the recovered folders.

    Terminal script:
    defaults write com.apple.finder AppleShowAllFiles NO
    killall Finder
     
  2. essiw macrumors member

    Joined:
    May 17, 2015
    Location:
    Netherlands
    #2
    Instead of FALSE it should be NO if I am correct, this changed somewhere in the past.
     
  3. ardchoille50 macrumors 68020

    Joined:
    Feb 6, 2014
    #3
    According to a few tutorials that have been updated in December 2015, and are working on El Capitan, you are correct.
     
  4. schwine1 thread starter macrumors regular

    Joined:
    Sep 13, 2008
    #4
    I've tried manually typing the above script in Terminal with NO and the DS_Store files are still visible.
    Is there another way to make the DS_Store files invisible?
     
  5. paulrbeers macrumors 68040

    Joined:
    Dec 17, 2009
    #5
    You are probably better off asking this question in the OSX discussion board as opposed to the Mini. This tends to be more hardware related discussions and not software.....
     
  6. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #6
    Yep... I just tested in El Capitan and this will hide them.

    Code:
    defaults write com.apple.finder AppleShowAllFiles -bool NO
    Code:
    killall Finder
     
  7. DeltaMac macrumors 604

    DeltaMac

    Joined:
    Jul 30, 2003
    Location:
    Delaware
    #7
    You can also try toggling that invisibility command.
    run with a Yes first. Restart, then run again with a No.
    (You don't need a restart, but simply something that I do when running that command)

    If that doesn't work, then you may need to use a chflags command. I'm kinda guessing on that one...
     
  8. DeltaMac macrumors 604

    DeltaMac

    Joined:
    Jul 30, 2003
    Location:
    Delaware
    #8
    Have you tried toggling invisibility on (making all invisible files visible), then off?
     
  9. campyguy macrumors 68040

    Joined:
    Mar 21, 2014
    Location:
    Portland / Seattle
    #9
    I use Onyx's Finder tweaks to show/hide DS_Store files, and Restart as well.
     
  10. richard2 macrumors regular

    richard2

    Joined:
    Oct 21, 2010
    Location:
    England, United Kingdom
    #10
    The following is the correct command:

    Code:
    defaults write com.apple.finder AppleShowAllFiles -bool false && killall -HUP Finder
     
  11. schwine1 thread starter macrumors regular

    Joined:
    Sep 13, 2008
    #11
    The visible DS_Store files are located on an external drive that is connected to a Mac Mini.
    Is there a way to make the external drive DS_Store files invisible? Thanks.
     
  12. JohnDS macrumors 65816

    Joined:
    Oct 25, 2015
    #12
    Sounds like the files are misnamed. There should be a dot in front of them to make them invisible. In other words, they should be named ".DS_Store" not "DS_Store".

    With the dot in front they will be invisible when the drive is connected to a Mac, but not when it is connected to a PC.
     
  13. richard2 macrumors regular

    richard2

    Joined:
    Oct 21, 2010
    Location:
    England, United Kingdom
    #13
    Please do the following:

    1. Open Terminal.
    2. Type the following:

      ls -leOdn
    3. Type a space.
    4. Drop one of the unhidden files onto the Terminal window.
    5. Click on the Terminal window and then press return.
    6. Include the contents of the Terminal window in a reply to this post.
     
  14. MacGizmo macrumors 6502a

    MacGizmo

    Joined:
    Apr 27, 2003
    Location:
    Arizona
    #14
    Just delete them. DS Store files are nothing critical anyway—they just store the preferences for that particular folder's View settings.

    If you recovered them from a damaged HD, they're probably corrupted anyway.
     
  15. randomgeeza macrumors 6502

    Joined:
    Aug 12, 2014
    Location:
    United Kingdom
    #15
    This should stop creation of them on external mounted drives:

    defaults write com.apple.desktopservices DSDontWriteNetworkStores true

    And this will delete all of them on your entire system, drives included if they are connected.

    sudo find / -name ".DS_Store" -depth -exec rm {} \;

    As already mentioned they are not critical and only store file view, icon data, which is recreated when you go back into the folder system.
     
  16. schwine1 thread starter macrumors regular

    Joined:
    Sep 13, 2008
    #16
    Yes, I think the files may be corrupt since they read as DS_Store as opposed to .DS_Store.
    That is, since the dot in front of .DS is the proper form for this file, and the dot is not present in the recovered files from the damaged hard disk.
     
  17. schwine1, Jun 21, 2016
    Last edited: Jun 21, 2016

    schwine1 thread starter macrumors regular

    Joined:
    Sep 13, 2008
    #17
    After I type in this sudo command in the Terminal window, a warning message appears and asks for my password.

    The problem is that after the warning message appears in the Terminal window, I am not able to type in my password. The reason is that the mouse curser is not seemingly allowed to appear in the Terminal window after the warning message appears. It's as if the Terminal window gets frozen for some reason, and I've tried the process a few times now with the same result. I'm already in my Administrator account, and I even logged out and logged back into my Administrator account, but the same warning message appears, and I am unable to type in my password for the reason just noted. This sudo command may solve the problem, but getting Terminal to accept the command seems challenging.
    --- Post Merged, Jun 21, 2016 ---
    Here are the contents of the Terminal window as requested.
    Most of the DS_Store files on the external drive are associated with mp3 music files.
    ------------------------------------------------------------------------------
    Last login: Tue Jun 21 21:42:38 on ttys000

    -mac-mini:~ $ Is -IeOdn /Volumes/External\ Drive/My\ Documents/sound\ files/06\ music\ sets/Music\ Sets/04\ sets \ artists/DS_Store

    -bash: Is: command not found

    mac-mini:~ x$ ghchv
     

    Attached Files:

  18. richard2, Jun 21, 2016
    Last edited: Jun 21, 2016

    richard2 macrumors regular

    richard2

    Joined:
    Oct 21, 2010
    Location:
    England, United Kingdom
    #18
    Firstly, don't use randomgeeza's command because it contains errors. Do the following instead:

    1. In Finder, press shift-command-C.
    2. Open the volume that contains the unwanted files.
    3. Press command-F.
    4. Enter the following into the search field and then press return:

      name:DS_Store
    5. Select one of the unwanted files and then press command-A.
    6. Press option-command-delete and then press Delete.

    In Terminal, most password prompts don't show your input to prevent others from discovering the length of your password.
     
  19. DeltaMac macrumors 604

    DeltaMac

    Joined:
    Jul 30, 2003
    Location:
    Delaware
    #19
    Just to reinforce what richard2 posted:
    When typing the password in the terminal, you will NOT see any response in the terminal as you type your password, it is a security feature of the terminal. So, just type your password, then press enter. That will work :D
     
  20. schwine1 thread starter macrumors regular

    Joined:
    Sep 13, 2008
    #20
    Thanks richard2. Your instructions worked perfectly.
    This process was helpful since there were almost 4,000 visible DS_Store files to delete. Thanks again.
     

Share This Page