2

Since upgrading to Yosemite, there seems to be an extra class of hidden files that are 'more hidden'. They are visible when I run ls, but not in my Finder (even though regular hidden files are visible on my machine).

For example, I can see .DS_Store in Finder, but then when I run ls in my terminal I can see extra versions:

.DS_Store
._.DS_Store.4ohM2f
._.DS_Store.b03KXd
._.DS_Store.zFFTiN

I suspect they might be some kind of revision history being saved for Time Machine, but I haven't set up Time Machine on my computer.

What are they and how do I get rid of them?

  • The ._.DS_Store.random_extension files, e.g. ._.DS_Store.4ohM2f, have nothing to do with Time Machine and are probably orphaned and why they can be seen in Terminal as normally they shouldn't and normally should have been deleted when updating the ._.DS_Store file . If they existed on my system I'd delete them using the find command, however do it at your own risk. find \ -name "._.DS_Store.*" -delete – user3439894 Jun 8 '15 at 14:20
  • But why can't I see them in Finder and other places like my IDE file browser? I can see normal hidden files, just not these ones. This makes me think these files are something OS-related. – callum Jun 8 '15 at 16:12
  • user3439894: Have you ever tried the command dot_clean? – David Anderson Jun 8 '15 at 16:31
  • @David Anderson, I totally forgot about dot_clean and certainly recommend using it over deleting with the find command. I'd do it first with -- Merge and then with -n and if any ._.DS_Store.random_extension files, e.g. ._.DS_Store.4ohM2f, exist after that resort to using find with -delete. – user3439894 Jun 8 '15 at 16:51
  • The issue here is not how to delete files, I can do that. I'm trying to understand what these files are, what put them there, etc, and how to prevent them appearing in future. – callum Jun 8 '15 at 18:47
2

I will offer one example involving files with the prefix ._.

I have two volumes named Steelhead2 and Shark3. The volume named Steelhead is hfs+ formatted and the volume named Shark3 is ExFAT formatted. Consider the file iprogram.txt which has extended attributes. I can display these attributes using the ls command as shown below.

Steelhead:Steelhead2 davidanderson$ ls -l@ /Volumes/Steelhead2/iprogram.txt
-rw-r--r--@ 1 davidanderson  staff  22668 May 26 10:22 /Volumes/Steelhead2/iprogram.txt
    com.apple.FinderInfo       32 
    com.apple.TextEncoding     15 

Using the Finder, I copy this file to an empty folder named dots on Shark3. Again using the ls command I get the following.

Steelhead:dots davidanderson$ ls -la@ /Volumes/Shark3/dots
total 1024
drwxrwxrwx  1 davidanderson  staff  131072 Jun  8 10:46 .
drwxrwxrwx  1 davidanderson  staff  131072 Dec 31  1979 ..
-rwxrwxrwx  1 davidanderson  staff    4096 Jun  8 10:47 ._iprogram.txt
-rwxrwxrwx@ 1 davidanderson  staff   22668 May 26 10:22 iprogram.txt
    com.apple.FinderInfo        32 
    com.apple.TextEncoding      15 

Partitions formatted ExFat can not have extended attributes. So OS X created the file ._iprogram.txt to contain these attributes. Next, I create a new folder named dots on Steelhead2 and use the Finder to copy just iprogram.txt to this folder. Using ls, I get the following.

Steelhead:Steelhead2 davidanderson$ ls -la@ /Volumes/Steelhead2/dots
total 48
drwxr-xr-x   3 davidanderson  staff    102 Jun  8 11:12 .
drwxrwxr-x  26 davidanderson  staff    952 Jun  8 11:11 ..
-rwxrwxrwx@  1 davidanderson  staff  22668 May 26 10:22 iprogram.txt
    com.apple.FinderInfo       32 
    com.apple.TextEncoding     15 

Since Steelhead2 is hfs+ formatted, there is no need for a ._iprogram.txt file. Finally, returning to the folder /Volumes/Shark3/dots, I will remove the file ._iprogram.txt and enter the 'ls' command, as shown below.

Steelhead:dots davidanderson$ rm /Volumes/Shark3/dots/._iprogram.txt
Steelhead:dots davidanderson$ ls -la@ /Volumes/Shark3/dots
total 768
drwxrwxrwx  1 davidanderson  staff  131072 Jun  8 10:46 .
drwxrwxrwx  1 davidanderson  staff  131072 Dec 31  1979 ..
-rwxrwxrwx  1 davidanderson  staff   22668 May 26 10:22 iprogram.txt

The extended attributes are gone.

You are correct, these ._ prefixed files are hidden in the Finder. Even if you use defaults write com.apple.finder AppleShowAllFiles TRUE, these files remain hidden.

If you find ._ files in your hfs+ formatted partitions, some operation did not get synchronized property. Try using the command dot_clean to remove these '._' files. For more information either enter man dot_clean or see dot_clean -- Merge ._* files with corresponding native files.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .