The comfiest way to work with Linux extended attributes (xattrs) written in pure Rust and made of delicious, fibrous Open Source code.
By default, the get
subcommand outputs a tab-separated table with a column order of path
, field
, value
. The value bytes are written to stdout as-is without decoding.
By contrast, when outputting JSON, Mattress attempts to decode values as UTF-8, filling in a default codepoint when the decoding fails.
Mattress was developed in conjunction with the Audiotater audio annotation tool.
This software is licensed under GPL version 3 only
mtr mv path1.txt path2.txt
: move all xattrs from path1.txt to path2.txtmtr mv -f id path1.txt path2.txt
: move xattr id
from path1.txt to path2.txtmtr mv -f id -f url path1.txt path2.txt
: move xattrs id
and url
from path1.txt to path2.txtmtr cp path1.txt path2.txt
: copy all xattrs from path1.txt to path2.txtmtr cp -f id path1.txt path2.txt
: copy xattr id
from path1.txt to path2.txtmtr cp -f id -f url path1.txt path2.txt
: copy xattrs id
and url
from path1.txt to path2.txtmtr rm path.txt
: remove all xattrs on path.txtmtr rm -f id path.txt
: remove xattr id
from path.txtmtr rm -f id -f url path1.txt path2.txt path3.txt
: remove xattrs id
and url
from path1.txt, path2.txt, and path3.txtmtr set -s id=123 path1.txt
: set xattr id
to value 123
on path1.txtmtr set -s id=123 -f url=http://example.com path1.txt path2.txt path3.txt
: set xattr id
to value 123
and xattr url
to value http://example.com
on path1.txt, path2.txt, and path3.txtmtr get path1.txt
: print all xattrs associated with path1.txt raw (undecoded) TSVmtr get -f id path1.txt
: print xattr id
and its value on path1.txt as raw (undecoded) TSVmtr get -f id -f url path1.txt path2.txt path3.txt
: print xattrs id
and url
and their respective values on path1.txt, path2.txt, and path3.txt as raw (undecoded) TSVmtr get -j path1.txt
: print all xattrs associated with path1.txt as UTF-8 decoded JSONmtr get -j -f id path1.txt
: print xattr id
and its value on path1.txt as UTF-8 decoded JSONmtr get -j -f id -f url path1.txt path2.txt path3.txt
: print xattrs id
and url
and their respective values on path1.txt, path2.txt, and path3.txt as JSON