setfattr
Sets an extended attribute name and value for a file or directory.
Returns 0
on success and non-zero on error.
The usage is as follows:
$ hadoop fs -setfattr -n name [-v value] | -x name <path>
-n |
The extended attribute name |
-v |
The extended attribute value. There are three different encoding methods for the value. If the argument is enclosed in double quotes, then the value is the string inside the quotes. If the argument is prefixed with |
-x |
Removes the extended attribute |
<path> |
A path to a file or a directory |
Example:
$ hadoop fs -setfattr -n user.myAttr -v myValue /file
$ hadoop fs -setfattr -n user.noValue /file
$ hadoop fs -setfattr -x user.myAttr /file