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>
Arguments

-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 0x or 0X, then it’s taken as a hexadecimal number. If the argument begins with 0s or 0S, then it’s taken as a base64 encoding

-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
Found a mistake? Seleсt text and press Ctrl+Enter to report it