Seth Woolley's Man Viewer

Manual for attr - man attr

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

ATTR(1)                      XFS Compatibility API                     ATTR(1)



NAME
       attr(1,5) - extended attributes on XFS filesystem objects

SYNOPSIS
       attr(1,5) [ -LRq ] -s attrname [ -V attrvalue ] pathname

       attr(1,5) [ -LRq ] -g attrname pathname

       attr(1,5) [ -LRq ] -r attrname pathname


OVERVIEW
       Extended  attributes  implement  the  ability  for  a  user  to  attach
       name:value pairs to objects within the XFS filesystem.

       They could be used to store meta-information about the file.  For exam-
       ple  "character-set=kanji"  could  tell  a  document browser to use the
       Kanji character set(7,n,1 builtins) when displaying that document  and  "thumbnail=..."
       could  provide  a  reduced  resolution  overview  of  a high resolution
       graphic image.

       This document describes the attr(1,5) command, which  is  mostly  compatible
       with  the IRIX command of the same name.  It is thus aimed specifically
       at users(1,5) of the XFS filesystem - for  filesystem  independent  extended
       attribute  manipulation,  consult the getfattr(1) and setfattr(1) docu-
       mentation.

       In the XFS filesystem, the names can be up to 256 bytes in(1,8) length, ter-
       minated  by  the  first  0  byte.  The intent is that they be printable
       ASCII (or other character set(7,n,1 builtins)) names for the attribute.  The values can
       be up to 64KB of arbitrary binary data.

       Attributes  can  be attached to all types of XFS inodes: regular files,
       directories, symbolic links, device nodes, etc.

       XFS uses  2  disjoint  attribute  name  spaces  associated  with  every
       filesystem  object.   They  are  the root and user address spaces.  The
       root address space is accessable only to the superuser, and  then  only
       by  specifying  a flag argument to the function call.  Other users(1,5) will
       not see or be able to modify attributes in(1,8) the root address space.  The
       user  address  space is protected by the normal file(1,n) permissions mecha-
       nism, so the owner of the file(1,n) can decide who is  able  to  see  and/or
       modify the value of attributes on any particular file.

DESCRIPTION
       The attr(1,5) utility allows the manipulation of extended attributes associ-
       ated with filesystem objects from within shell scripts.

       There are four main operations that attr(1,5) can perform:

       GET    The -g attrname option tells attr(1,5) to search the named(5,8) object and
              print (to stdout) the value associated with that attribute name.
              With the -q flag, stdout will be exactly and only the  value  of
              the attribute, suitable for storage directly into a file(1,n) or pro-
              cessing via a piped command.

       REMOVE The -r attrname option tells attr(1,5) to remove  an  attribute  with
              the  given  name from the object if(3,n) the attribute exists.  There
              is no output on sucessful completion.

       SET/CREATE
              The -s attrname option tells attr(1,5) to set(7,n,1 builtins) the named(5,8) attribute  of
              the  object  to the value read(2,n,1 builtins) from stdin.  If an attribute with
              that name already exists, its value will be replaced  with  this
              one.  If an attribute with that name does not already exist, one
              will be created with this value.  With the  -V  attrvalue  flag,
              the attribute will be set(7,n,1 builtins) to have a value of attrvalue and stdin
              will not be read.  With the -q flag, stdout will  not  be  used.
              Without  the  -q  flag, a message showing the attribute name and
              the entire value will be printed.

       When the -L option is given and the named(5,8) object is  a  symbolic  link(1,2),
       operate  on  the  attributes  of  the object referenced by the symbolic
       link.  Without this option, operate on the attributes of  the  symbolic
       link(1,2) itself.

       When the -R option is given and the process has appropriate privileges,
       operate in(1,8) the root attribute namespace rather that the USER  attribute
       namespace.

       When  the -q option is given attr(1,5) will try to keep quiet.  It will out-
       put error(8,n) messages (to stderr) but will not print status  messages  (to
       stdout).

NOTES
       The standard file(1,n) interchange/archive programs tar(1), and cpio(1) will
       not archive or restore extended attributes, while the  xfsdump(8)  pro-
       gram will.

CAVEATS
       The list option present in(1,8) the IRIX version(1,3,5) of this command is not sup-
       ported.  getfattr provides a mechanism to retrieve all of the attribute
       names.

SEE ALSO
       getfattr(1),   setfattr(1),  attr_get(3,3x,3x PAIR_NUMBER)(3),  attr_set(3,3x,3x PAIR_NUMBER)(3),  attr_multi(3),
       attr_remove(3), attr(1,5)(5), and xfsdump(8).



Dec 2001                      Extended Attributes                      ATTR(1)

References for this manual (incoming links)