Hi Peter, GNU find doesn't currently support searching for files based on extended attributes, but there is an alternative program that does.
My rawhide (rh) program (raf.org/rawhide) is an alternative to find which can search by extended attribute names and/or values (among many other things). The upcoming version (see github.com/raforg/rawhide or codeberg.org/raforg/rawhide) is even able to extract extended attribute names and values as a machine-readable structured JSON object. The last released version (3.3) has JSON output, but the extended attributes aren't output in the form of a structured JSON object. It's just an encoded string containing all of the extended attributes). The upcoming version is much better. The extended attribute values might need to be decoded (if binary) but there's a tiny standalone perl script to do that (rhea-decode). The upcoming version should be released soon (as soon as I've translated the manual entries into French). I'm a huge fan of the GLAM sector (as a punter) so if there's anything that you'd like me to add to rawhide, please let me know. Having said all that, adding xattr support to GNU find would be awesome. You're not the first to ask for it. If you can arrange funding to get that to happen, it would make the world a better place. cheers, raf On Thu, Dec 18, 2025 at 09:42:22PM +0100, "Peter B." <[email protected]> wrote: > Hi everyone! > > This is not about a bug, it's more a feature (re)quest(ion), but this is the > only list I found on [How to contact findutils: > (gnu.org)](https://www.gnu.org/software/findutils/). Please feel free to > point me somewhere else, if you feel there's a better place to talk about > "xattrs and find" :) > > So I'm working with laaaarge datasets: of metadata and nnn-GBs (or larger) > binary files in different file formats in the GLAM (Galleries Libraries > Archives Museums) sector as developer, admin and workflow designer. I've > recently fell in love with "xattrs" (combined file-object access "by ID" - > not path/filename). > > I've discovered that many core GNU/Linux environment applications and > programming libraries support Extended Attributes (xattrs) out of the box - > just not by default (yet): rsync, tar, cp, yt-dlp > > =================== > Would you be interested, and would it be possible to add xattr key-or-value > search-functionality to find(utils)? > > I'm not expecting this to be for free, and if I get an offer from you, I may > be able to get funding. > > I'm convinced, improving reliable and seamless xattr support is a great > advantage to any tool these days: Like having seamless unicode character > filenames, compared to DOS 8.3 UPPERCASE ASCII characters only - for today's > daily use of "file objects" :D > =================== > > Imagine, if GNU `find` would allow searching by xattr key-or-value too? > > > I'd be very happy to hear from you. > Personally, I'm using xattrs to handle data already for ~1.5y, and I'm > super-happy about using the filesystem as simple database. > > Thanks and regards! > Peter
