Imported Upstream version 2.4.46
[platform/upstream/attr.git] / man / man1 / setfattr.1
1 .\" Copyright (C) 2002, 2004  Silicon Graphics, Inc. Al rights reserved.
2 .\" Copyright (C) 2002, 2004  Andreas Gruenbacher <agruen@suse.de>
3 .\"
4 .\" You should have received a copy of the GNU General Public License
5 .\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
6 .\"
7 .\" This is free documentation; you can redistribute it and/or
8 .\" modify it under the terms of the GNU General Public License as
9 .\" published by the Free Software Foundation; either version 2 of
10 .\" the License, or (at your option) any later version.
11 .\"
12 .\" The GNU General Public License's references to "object code"
13 .\" and "executables" are to be interpreted as the output of any
14 .\" document formatting or typesetting system, including
15 .\" intermediate and printed output.
16 .\"
17 .\" This manual is distributed in the hope that it will be useful,
18 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
19 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 .\" GNU General Public License for more details.
21 .\"
22 .\" You should have received a copy of the GNU General Public
23 .\" License along with this manual.  If not, see
24 .\" <http://www.gnu.org/licenses/>.
25 .\"
26 .TH SETFATTR 1 "Extended Attributes" "Dec 2001" "File Utilities"
27 .SH NAME
28 setfattr \- set extended attributes of filesystem objects
29 .SH SYNOPSIS
30 .nf
31 \f3setfattr\f1 [\f3\-h\f1] \f3\-n name\f1 [\f3\-v value\f1] \f3pathname\f1...
32 \f3setfattr\f1 [\f3\-h\f1] \f3\-x name\f1 \f3pathname\f1...
33 \f3setfattr\f1 [\f3\-h\f1] \f3\-\-restore=file\f1
34 .fi
35 .SH DESCRIPTION
36 The 
37 .B setfattr
38 command associates a new
39 .I value
40 with an extended attribute
41 .IR name
42 for each specified file.
43 .SH OPTIONS
44 .TP 4
45 .BR \-n " \f2name\f1, " \-\-name "=\f2name\f1"
46 Specifies the name of the extended attribute to set.
47 .TP
48 .BR \-v " \f2value\f1, " \-\-value "=\f2value\f1"
49 Specifies the new value of the extended attribute. There are three methods
50 available for encoding the value.  If the given string is enclosed in double
51 quotes, the inner string is treated as text. In that case, backslashes and
52 double quotes have special meanings and need to be escaped by a preceding
53 backslash. Any control characters can be encoded as a backslash followed by
54 three digits as its ASCII code in octal. If the given string begins with 0x or
55 0X, it expresses a hexadecimal number. If the given string begins with 0s or
56 0S, base64 encoding is expected.  See also the \-\-encoding option of
57 getfattr(1).
58 .TP
59 .BR \-x " \f2name\f1, " \-\-remove "=\f2name\f1"
60 Remove the named extended attribute entirely.
61 .TP
62 .BR \-h ", " \-\-no-dereference
63 Do not follow symlinks.  If
64 .I pathname
65 is a symbolic link, it is not followed, but is instead itself the
66 inode being modified.
67 .TP
68 .BR \-\-restore =\f2file\f1
69 Restores extended attributes from file.
70 The file must be in the format generated by the
71 .B getfattr
72 command with the
73 .B \-\-dump
74 option.
75 If a dash (\c
76 .IR \- )
77 is given as the file name,
78 .B setfattr
79 reads from standard input.
80 .TP
81 .B \-\-version
82 Print the version of
83 .B setfattr
84 and exit.
85 .TP
86 .B \-\-help
87 Print help explaining the command line options.
88 .TP
89 .B \-\-
90 End of command line options.
91 All remaining parameters are interpreted as file names, even if they
92 start with a dash character.
93 .SH AUTHOR
94 Andreas Gruenbacher,
95 .RI < a.gruenbacher@bestbits.at >
96 and the SGI XFS development team,
97 .RI < linux-xfs@oss.sgi.com >.
98 .P
99 Please send your bug reports or comments to these addresses.
100 .SH "SEE ALSO"
101 getfattr(1), and attr(5).