5

In Linux can I find files through the extended attributes I define? Since I can find files through its basic attributes like the file's type and others, I wonder if this is possible (because in Windows, defining extra atributes to files through Alternate Data Streams, it isn't possible to find them, at least using the Windows Search tool).

ᄂ ᄀ
  • 4,187
ele
  • 63

2 Answers2

3

The standard version of find that comes installed as part of any Linux system cannot do this. However, some time ago I wrote a patch allowing it to search by the presence of an extended attribute. So you can download that patch, apply it to the findutils source code, then compile and install your custom version of find, and you should be able to use it to find files by extended attribute. (The patch is for findutils 4.4.0, although it might also work on the latest version, 4.4.2. If you try it, I'd be interested to get any feedback.)

There are probably other search programs that do index extended attributes, but I don't know of any. It seems to be somewhat difficult to find information on them on Google.

David Z
  • 6,785
2

There is now a fresh utility that wraps find and supports this for any POSIX compliant OS, you can find it at https://github.com/Cbhihe/findxattr

ᄂ ᄀ
  • 4,187
Gregor
  • 139