attr - Unix, Linux Command


Advertisements

Previous Page
Next Page  
 

NAME

attr: set, list or remove extended attributes

SYNOPSIS

DESCRIPTION

attr command is used to set, list or remove extended attributes on XFS filesystem objects. XFS is a Linux filesystem which is NAS devices. That is this command is used to maninpulate on the extended attributes associated with filesystem objects from within shell scripts. The extended attributes implement the ability for a user to attach name:value pairs to objects within the XFS filesystem. There are four main operations that attr can perform:

OPTIONS

Tag Description
-L When -L option is given and the named object is a symbolic link, operate on the attributes of the object referenced by the symbolic link. Without this option, operate on the attributes of the symbolic link itself.
-R When the -R option is given and the process has appropriate privileges, operate in the root attribute namespace rather that the USER attribute namespace.
-S The -S option is similar, except it specifies use of the security attribute namespace.
-q When the -q option is given attr will try to keep quiet. It will output error messages (to stderr) but will not print status messages (to stdout).

EXAMPLES

EXAMPLE-1:

Consider a file test.php, now let's set two attributes name and class for the file as follows: :

$ attr -s "name" -V "class" act.php

The above command will produce the below output:

output:

Attribute "name" set to a 5 byte value for act.php:
class

EXAMPLE-2:

Following is an example to list down all the attributes associated with test.php file:

$ attr -l test.php
The above command will produce the below output:

output:

Attribute "name" has a 5 byte value for act.php

EXAMPLE-3:

Following is an example to list down only particular attribute:

$ attr -g "name" act.php
The above command will produce the below output:
output:

Attribute "name" had a 5 byte value for act.php:
class

Previous Page
Next Page