setea Command

Purpose

Writes or deletes a named extended attribute to a file.

Syntax

setea -n Name [ -l ]{ -v Value | -d | -f EAFile } FileName ...

Description

The setea command writes or deletes a named extended attribute to a file. The file must be in a file system which supports named extended attributes, such as JFS2 using v2 extended attribute format.

Note: To prevent naming collisions, JFS2 has reserved the 8-character prefix (0xf8)SYSTEM(0xF8) for system-defined extended attributes. Avoid using this prefix for naming user-defined extended attributes.

This command is not used to set ACLs. To set ACLs, use the aclput command.

Flags

Item Description
-d Specifies to delete the named extended attribute from the file.
-f EAFile EAFile specifies a file which contains the EA value. If an extended attribute matching the specified name already exists for the FileName, then the value will be changed to the value specified.
-l Specifies to write or delete the extended attribute from the symbolic link itself rather than the file to which it is pointing.
-n Name Specifies the name of the extended attribute to be written.
-v Value Specifies the value of the named extended attribute. If an extended attribute matching the specified name already exists for the file, then the value will be changed to the value specified. Value is treated as a character string. It should be enclosed in quotes if it contains spaces.
FileName ... Specifies the file or files from which to write or delete the extended attribute.

Exit Status

Item Description
0 Successful completion.
Positive integer An error occurred.

Security

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in AIX® Version 7.1 Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

  1. To create an extended attribute with a name of Approver and a value of Grover for file design.html, enter:
    setea -n Approver -v Grover design.html
  2. To modify an extended attribute named Approver to new value of Joon for file design.html, enter:
    setea -n Approver -v Joon design.html 
  3. To remove an extended attribute named Approver from file design.html, enter:
    setea -n Approver -d design.html 
  4. To create an extended attribute with a name of Approver and a value of Zach for the symbolic link design.html, enter:
    setea -n Approver -v Zach -l design.html

Location

/usr/sbin