File will not delete

Discussion in 'OS X El Capitan (10.11)' started by hawkeyefxr, Apr 9, 2016.

  1. hawkeyefxr macrumors newbie

    Joined:
    Jul 12, 2012
    #1
    I have a file called .DS_store on the desktop that will not delete. I have renamed it and deleted it and it just reappears again.
    If i copy it to downloads it is greyed out so i take it it is a hidden file ?
     
  2. Nermal Moderator

    Nermal

    Staff Member

    Joined:
    Dec 7, 2002
    Location:
    New Zealand
    #2
    It should indeed be hidden. It's normal for it to be recreated, but it's not normal for it to show up. Try doing this in a terminal:

    chflags hidden ~/Desktop/.DS_Store
     
  3. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #3
    That file contains the Finder settings (like column order etc) for the Desktop folder. Like Nermal said, it would normally be a hidden file. Have you been messing about in Terminal or some utility that may have caused hidden files to be shown?
     
  4. mag01, Apr 9, 2016
    Last edited: Apr 9, 2016

    mag01 macrumors regular

    Joined:
    Apr 10, 2011
    #4
    Actually any files/directories whose names start with the dot character (dot files) are treated as hidden and thus it shouldn't be necessary to set their hidden flag. Thus as Weaselboy suggets, the OP has most likely (maybe inadvertently) changed the Finder settings to show such hidden files. Usually it's the following setting (commands for the Terminal follow):

    - to verify the current value - normally it should return an error "The domain/default pair of (/Users/.../Library/Preferences/com.apple.finder, AppleShowAllFiles) does not exist" or value "0":
    Code:
    defaults read com.apple.finder AppleShowAllFiles
    - to enable - e.g. reveal hidden files:
    Code:
    defaults write com.apple.finder AppleShowAllFiles -boolean TRUE
    killall Finder
    - to disable - e.g. revert to the default state when hidden files are not shown:
    Code:
    defaults delete com.apple.finder AppleShowAllFiles
    killall Finder
     
  5. Nermal Moderator

    Nermal

    Staff Member

    Joined:
    Dec 7, 2002
    Location:
    New Zealand
    #5
    I know :) but it was just something to try. I didn't know how to set Finder to show/hide hidden files, but it sounds like that's a better solution.
     

Share This Page