Clone wiki

attrfs / Home



Imagine you have a lot of images, and you want to sort them into different folders. Suddenly you come across a picture that fits into two of your folder categories. What to do? Copy the image? Create a link? Wouldn't it be better if you could just copy your image to every folder without thinking about how it's done?

Now imagine that you somehow have solved the problem of having your files in a multitude of folders at once. Now you would like to know which images with a sky that has your friend Liza in them, but not your nemesis Freud. These are the images that reside in both environment/sky and persons/Liza but not in persons/Freud. With each folder containing some 1000 pictures going through each folder to try to figure out which images are or are not in each will be a daunting task. Isn't there a better way?

Well, now there is! Attrfs does just that, letting you sort images into multiple category folders and then letting you perform searches by simply traversing the search part of the directory tree!


Attrfs is a file system originally designed to be an image sorting file system, eventhough it in no way is limited to images alone.

The sorting is done by either adding extended attributes to files, which makes them appear in corresponding attribute folders, or moving/copying the files to attribute folders, which makes the files have the corresponding extended attributes.

Once files have been given attributes, one can perform attribute based searches. The file system also spots duplicates in the directory from which the images to be sorted is taken.


Duplicate files detection

If a filename occurs multiple times in the file system, a file is created with the name files/duplicates/<filename>.txt containing a list of where in the file system duplicate files are.
Files that are not duplicates of any other file will have a corresponding text file in files/unique/<filename>.txt.


Most system folders can be renamed by setting options in the env part of the If you want a file system in which logic/foo/AND/bar is written as parse/foo/&/bar, just set {logic_dir,"parse"} and {and_dir,"&"} in From version 0.2.6 onwards, you can also use the more user friendly (and preferred) ~/.xattrfsrc to configure the file system.
(See or ~/.xattrfsrc for more info.)


Create folders in the attribute part of the file system, and move files to all attribute folders where you want them.


Perform filtering by traversing folders in the filtering part of the file system, using the special folders AND, OR and BUTNOT to show only the files you want.

Programmer friendly interface

With the extended attributes interface, you can do things like attr -s "foo,bar" "baz,etaoin/shrdlu" to set the attributes foo/baz,foo/etaoin/shrdlu, bar/baz and bar/etaoin/shrdlu using only one command.


using a gui

See separate page

using a terminal

$ ls files/all

$ attr -s etaoin -V shrdlu files/all/foo
Attribute "etaoin" set to a 6 byte value for files/all/foo:

$ ls attributes/etaoin/shrdlu/

$ mkdir -p attributes/foo/bar

$ mv attributes/etaoin/shrdlu/foo attributes/foo/bar/

$ attr -l files/all/foo 
Attribute "etaoin" has a 6 byte value for files/all/foo
Attribute "foo" has a 3 byte value for files/all/foo

$ attr -g foo files/all/foo
Attribute "foo" had a 3 byte value for files/all/foo:

$ ls logic/etaoin/shrdlu/AND/foo/bar/


You need to have fuserl and fuse in order to run the application. Linux will certainly help to have, as well.