Imported Upstream version 2.4.46
[platform/upstream/attr.git] / man / man1 / getfattr.1
1 .\" Copyright (C) 2002, 2004, 2007  Silicon Graphics, Inc. All rights reserved.
2 .\" Copyright (C) 2002, 2004, 2007  Andreas Gruenbacher <agruen@suse.de>
3 .\"
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\"
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
13 .\"
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 .\" GNU General Public License for more details.
18 .\"
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual.  If not, see
21 .\" <http://www.gnu.org/licenses/>.
22 .\"
23 .TH GETFATTR 1 "Extended Attributes" "Dec 2001" "File Utilities"
24 .SH NAME
25 getfattr \- get extended attributes of filesystem objects
26 .SH SYNOPSIS
27 .nf
28 \f3getfattr\f1 [\f3\-hRLP\f1] \f3\-n name\f1 [\f3\-e en\f1] \c
29 \f3pathname\f1...
30 \f3getfattr\f1 [\f3\-hRLP\f1] \f3\-d\f1 [\f3\-e en\f1] \c
31 [\f3\-m pattern\f1] \f3pathname\f1...
32 .fi
33 .SH DESCRIPTION
34 For each file,
35 .B getfattr
36 displays the file name,
37 and the set of extended attribute names (and optionally values) which
38 are associated with that file.
39 .PP
40 The output format of
41 .B "getfattr \-d"
42 is as follows:
43 .fam C
44 .RS
45 .nf
46  1:  # file: somedir/
47  2:  user.name0="value0"
48  3:  user.name1="value1"
49  4:  user.name2="value2"
50  5:  ...
51 .fi
52 .RE
53 .fam T
54 .PP
55 Line 1 identifies the file name for which the
56 following lines are being reported.
57 The remaining lines (lines 2 to 4 above) show the
58 .I name
59 and 
60 .I value
61 pairs associated with the specified file.
62 .SH OPTIONS
63 .TP 4
64 .BR \-n " \f2name\f1, " \-\-name "=\f2name\f1"
65 Dump the value of the named extended attribute extended attribute.
66 .TP
67 .BR \-d ", " \-\-dump
68 Dump the values of all extended attributes associated with
69 .IR pathname .
70 .TP
71 .BR \-e " \f2en\f1, " \-\-encoding "=\f2en\f1"
72 Encode values after retrieving them.
73 Valid values of
74 .I en
75 are "text", "hex", and "base64".
76 Values encoded as text strings are enclosed in double quotes ("),
77 while strings encoded as hexidecimal and base64 are prefixed with
78 0x and 0s, respectively.
79 .TP
80 .BR \-h ", " \-\-no-dereference
81 Do not dereference symlinks. Instead of the file a symlink refers to, the
82 symlink itself is examined.
83 .TP
84 .BR \-m " \f2pattern\f1, " \-\-match "=\f2pattern\f1"
85 Only include attributes with names matching the regular expression
86 .IR pattern .
87 The default value for
88 .I pattern
89 is "^user\\\\.", 
90 which includes all the attributes in the user namespace. Specify "\-" for
91 including all attributes.  Refer to
92 .BR attr (5)
93 for a more detailed discussion of namespaces.
94 .TP
95 .B \-\-absolute-names
96 Do not strip leading slash characters ('/').
97 The default behaviour is to strip leading slash characters.
98 .TP
99 .B \-\-only-values
100 Dump out the extended attribute value(s) only.
101 .TP
102 .BR \-R ", " \-\-recursive
103 List the attributes of all files and directories recursively.
104 .TP
105 .BR \-L ", " \-\-logical
106 Logical walk, follow symbolic links to directories.
107 The default behaviour is to follow symbolic link arguments, and to 
108 skip symbolic links encountered in subdirectories.
109 Only effective in combination with \-R.
110 .TP
111 .BR \-P ", " \-\-physical
112 Physical walk, do not follow symbolic links to directories.
113 This also skips symbolic link arguments.
114 Only effective in combination with \-R.
115 .TP
116 .B \-\-version
117 Print the version of
118 .B getfattr
119 and exit.
120 .TP
121 .B \-\-help
122 Print help explaining the command line options.
123 .TP
124 .B \-\-
125 End of command line options.
126 All remaining parameters are interpreted as file names, even if they
127 start with a dash character.
128 .SH AUTHOR
129 Andreas Gruenbacher,
130 .RI < a.gruenbacher@bestbits.at >
131 and the SGI XFS development team,
132 .RI < linux-xfs@oss.sgi.com >.
133 .P
134 Please send your bug reports or comments to these addresses.
135 .SH "SEE ALSO"
136 setfattr(1), and attr(5).