summaryrefslogtreecommitdiff
path: root/man/man1/getfattr.1
blob: 7b3ea66b83e1094da3b3d9368439dcef1506bf81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
.TH GETFATTR 1 "Extended Attributes" "Dec 2001" "File Utilities"
.SH NAME
getfattr, aget \- get extended attributes of filesystem objects
.SH SYNOPSIS
.nf
\f3getfattr\f1 [\f3\-lvR5LP\f1] \f3\-n name\f1 [\f3\-e en\f1] \c
\f3pathname\f1...
\f3getfattr\f1 [\f3\-lvR5LP\f1] \f3\-d\f1 [\f3\-e en\f1] \c
[\f3\-s\f1 | \f3\-r regex\f1] \f3pathname\f1...
\f3getfattr\f1 [\f3\-Vh\f1]
.fi
.SH DESCRIPTION
For each file,
.B getfattr
displays the file name,
and the set of extended attribute names (and optionally values) which
are associated with that file.
.PP
.B aget
is exactly the same as
.BR getfattr ,
and is installed for compatibility purposes.
.PP
The output format of
.B "getfattr \-ds"
is as follows:
.fam C
.RS
.nf
 1:  # file: somedir/
 2:  user.name0="value0"
 3:  system.name0="value1"
 4:  user.name1="value2"
 5:  ...
.fi
.RE
.fam T
.PP
Line 1 identifies the file name for which the
following lines are being reported.
The remaining lines (lines 2 to 4 above) show the
.I name
and 
.I value
pairs associated with the specified file.
.SS OPTIONS
.TP 4
.I \-n name
Dump the value of the named extended attribute extended attribute.
.TP
.I \-a
Absolute names \- suppress the stripping of leading '/' from an absolute
.IR pathname .
.TP
.I \-d
Dump the values of all extended attributes associated with
.IR pathname .
.TP
.I \-e en
Encode values after retrieving them.
Valid values of
.I en
are "text", "hex", and "base64".
.TP
.I \-l
Do not follow symlinks - if
.I pathname
is a symbolic link, it is not followed, but is instead itself the
inode being examined.
.TP
.I \-r
.I regex
is a regular expression pattern to apply to the set of extended
attribute names being returned.
It defaults to "^user\\." if no
.I \-r
is specified, which causes
.B getfattr
to operate on only extended attributes from the user namespace.
.TP
.I \-s
Dump out both the "user" and "system" namespaces.
Refer to
.BR attr (5)
for a more detailed discussion on namespaces.
This option is useful for backing up extended attributes in a filesystem
independent manner.
It is implemented using a regular expression ("^user\\.|^system\\.")
and so cannot be used in conjunction with the
.I \-r
option described earlier.
.TP
.I \-v
Dump out the extended attribute value(s) only.
.TP
.I \-R
Recurse into subdirectories, dumping extended attributes for each file
encountered (breadth first).
.TP
.I \-5
Same as \-R, except done in post-order (depth first).
.TP
.I \-L
Refines the \-R or \-5 option - "logical walk" (do follow symbolic links).
.TP
.I \-P
Refines the \-R or \-5 option - "physical walk" (do not follow symbolic links).
.TP
.I \-V
Print the version of
.B getfattr
and exit.
.TP
.I \-h
Print help explaining the command line options.
.TP
.I \-\-
End of command line options.
All remaining parameters are interpreted as file names, even if they
start with a dash character.
.SH AUTHOR
Andreas Gruenbacher,
.RI < a.gruenbacher@computer.org >
and the SGI XFS development team,
.RI < linux-xfs@oss.sgi.com >.
.P
Please send your bug reports or comments to these addresses.
.SH "SEE ALSO"
setfattr(1), and attr(5).