HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

setfattr — Set extended file attributes. More information: <https://manned.org/setfattr>.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
setfattrcommandextendedattributesclifilesetmore
linux

Problem

How to use the setfattr command: Set extended file attributes. More information: <https://manned.org/setfattr>.

Solution

setfattr — Set extended file attributes. More information: <https://manned.org/setfattr>.

Set name of attribute for file:
setfattr {{[-n|--name]}} user.{{attribute_name}} {{path/to/file}}


Set a user-defined value of an extended attribute on a file:
setfattr {{[-n|--name]}} user.{{attribute_name}} {{[-v|--value]}} "{{value}}" {{path/to/file}}


Remove a specific attribute of a file:
setfattr {{[-x|--remove]}} user.{{attribute_name}} {{path/to/file}}

Code Snippets

Set name of attribute for file

setfattr {{[-n|--name]}} user.{{attribute_name}} {{path/to/file}}

Set a user-defined value of an extended attribute on a file

setfattr {{[-n|--name]}} user.{{attribute_name}} {{[-v|--value]}} "{{value}}" {{path/to/file}}

Remove a specific attribute of a file

setfattr {{[-x|--remove]}} user.{{attribute_name}} {{path/to/file}}

Context

tldr-pages: linux/setfattr

Revisions (0)

No revisions yet.