What is `.file` in root boot volume for? [duplicate]

Solution 1:

You can query the package receipt database.

pkgutil --file-info /.file

on a machine running OS X 10.6 the results are

volume: /
path: /.file

pkgid: com.apple.pkg.BaseSystem
pkg-version: 10.6.0.1.1.1249291854
install-time: 1252683091
uid: 0
gid: 80
mode: 0

pkgid: com.apple.pkg.Essentials
pkg-version: 10.6.0.1.1.1249291854
install-time: 1252683099
uid: 0
gid: 80
mode: 0

Solution 2:

Yes, it's normal (and, as others have said, part of the standard OS installation).
It facilitates a natty Apple feature whereby files can be referenced by a composite key of device ID and inode ID, like this: /.file/id=6571367.17424234/
Every file and folder in your filesystem can be accessed via this alternate path.
One benefit of this 'reference' path is that it will not change when you rename a file (because the inode ID doesn't change when you rename a file). I think it's a fundamental part of how aliasing works on a Mac.

Don't remove it.

See 'file reference URL' in this Apple document.

Solution 3:

Yes it's normal and the .file file is part of the BaseSystemResources.pkg and Essentials.pkg packages within the InstallESD.dmg disk image of the Install OS X $version.app bundle, e.g. Install OS X Mountain Lion.app, however I do not know its purpose.

enter image description here