1 .TH lfs-find 1 "2018-01-24" Lustre "user utilities"
3 lfs-find \- Lustre client utility to list files with specific attributes
5 .B lfs find \fR<\fIdirectory\fR|\fIfilename \fR...>
6 [[\fB!\fR] \fB--atime\fR|\fB-A\fR [\fB-+\fR]\fIn[smhdwy]\fR]
7 [[\fB!\fR] \fB--blocks\fR|\fB-b\fR [\fB+-\fR]\fIn\fR]
8 [[\fB!\fR] \fB--btime\fR|\fB--Btime\fR|\fB-B\fR [\fB+-\fR]\fIn[smhdwy]\fR]
9 [[\fB!\fR] \fB--ctime\fR|\fB-C\fR [\fB+-\fR]\fIn[smhdwy]\fR]
10 [[\fB!\fR] \fB--component-count|\fB--comp-count\fR [\fB+-\fR]\fIn\fR]
11 [[\fB!\fR] \fB--component-end|\fB--comp-end\fR|\fB-E\fR [\fB+-\fR]\fIn\fR[\fBKMGTPE\fR]]
12 [[\fB!\fR] \fB--component-flags|\fB--comp-flags\fR <[^]\fIflag\fB,\fR...>]
13 [[\fB!\fR] \fB--component-start|\fB--comp-start\fR [\fB+-\fR]\fIn\fR[\fBKMGTPE\fR]]
14 [[\fB!\fR] \fB--extension-size|\fB-z\fR [\fB+-\fR]\fIn\fR[\fBKMG\fR]]
15 [[\fB!\fR] \fB--foreign\fR [<\fItype\fR>]]
16 [[\fB!\fR] \fB--gid\fR|\fB-g\fR|\fB--group\fR|\fB-G\fR <\fIgname\fR>|<\fIgid\fR>]
17 [[\fB!\fR] \fB--layout\fR|\fB-L mdt\fR,\fBraid0\fR,\fBreleased\fR]
19 [\fB--maxdepth\fR|\fB-D\fI n\fR]
20 [[\fB!\fR] \fB--mdt\fR|\fB--mdt-index\fR|\fB-m\fR <\fIuuid\fR|\fIindex\fR,...>]
21 [[\fB!\fR] \fB--mdt-count\fR|\fB-T\fR [\fB+-\fR]\fIn\fR]
22 [[\fB!\fR] \fB--mdt-hash\fR|\fB-H \fR<[^]\fIhashflag\fR,[^]\fIhashtype\fR,...>]
23 [[\fB!\fR] \fB--mirror-count|\fB-N\fR [\fB+-\fR]\fIn\fR]
24 [[\fB!\fR] \fB--mirror-state\fR <[^]\fIstate\fR>]
25 [[\fB!\fR] \fB--mtime\fR|\fB-M\fR [\fB-+\fR]\fIn[smhdwy]\fR]
26 [[\fB!\fR] \fB--name\fR|\fB-n <\fIpattern\fR>]
27 [[\fB!\fR] \fB--newer\fR[\fBXY\fR] <\fIreference\fR>]
28 [[\fB!\fR] \fB--ost\fR|\fB-O\fR <\fIindex\fR,...>]
29 [[\fB!\fR] \fB--perm\fR [\fB/-\fR]<\fImode\fR> ]
30 [[\fB!\fR] \fB--pool\fR <\fIpool\fR>]
31 [\fB--print\fR|\fB-P\fR]
32 [\fB--print0\fR|\fB-0\fR]
33 [[\fB!\fR] \fB--projid\fR |<\fIprojid\fR>]
34 [[\fB!\fR] \fB--size|\fB-s\fR [\fB-+\fR]\fIn\fR[\fBKMGTPE\fR]]
35 [[\fB!\fR] \fB--stripe-count|\fB-c\fR [\fB+-\fR]\fIn\fR]
36 [[\fB!\fR] \fB--stripe-index|\fB-i\fR \fIn\fR,...]
37 [[\fB!\fR] \fB--stripe-size|\fB-S\fR [\fB+-\fR]\fIn\fR[\fBKMG\fR]]
38 [[\fB!\fR] \fB--type\fR|\fB-t\fR {\fBbcdflps\fR}]
39 [[\fB!\fR] \fB--uid\fR|\fB-u\fR|\fB--user\fR|\fB-U
40 <\fIuname\fR>|<\fIuid>\fR]
43 is similar to the standard
45 utility and is used to list files and directories with specific attributes,
46 both regular POSIX attributes such as ownership, timestamps, and size using
49 as well as Lustre-specific attributes such as stripe count and size,
50 OST and MDT location, and composite layout attributes.
54 File was last accessed \fIn\fR*24 hours ago (if no units are given),
55 or \fIn\fR*\fBs\fReconds, \fBm\fRinutes, \fBh\fRours, \fBd\fRays,
56 \fBw\fReeks, or \fBy\fRears ago within a margin of error of 24h
57 if no unit is specified. Multiple units can be specified,
58 for example \fB8h20m\fR is equivalent to \fB500m\fR. If multiple units
59 are specified, the margin of error is based on the smallest unit used, so
61 has a margin of error of one day, while
63 has a margin of error of one hour.
66 Blocks allocated by the file is \fIn\fR Kibibytes (if no units are given),
67 \fIn\fR 512-byte \fBb\fRlocks, or \fBK\fRibi-, \fBM\fRebi-, \fBG\fRibi-,
68 \fBT\fRebi-, \fBP\fRebi-, or \fBE\fRbi-bytes if that suffix is given.
70 .BR --btime | --Btime | -B
71 File was created \fIn\fR*24 hours ago, see
73 for full details and options.
76 File's status was last changed \fIn\fR*24 hours ago, see
78 for full details and options.
80 .BR --component-count | --comp-count
81 The file has \fIn\fR components in its layout.
83 .BR --component-end | --comp-end
84 The file has component end offset \fIn\fR (in bytes) for any component.
86 .BR --component-flags | --comp-flags
87 The file has components with the specified
91 is used, print only components not matching
93 Multiple flags can be specified, separated by commas. Valid flag names are:
97 Component has been initialized (has allocated OST objects).
100 Replicated (mirrored) components that do not have up-to-date data. Stale
101 components will not be used for read or write operations, and need to be
104 before they can be accessed again.
107 Replicated (mirrored) components that are preferred for read or write.
108 For example, because they are located on SSD-based OSTs, or are more
109 local on the network to clients.
112 .BR --component-start | --comp-start
113 The file has component start offset \fIn\fR (in bytes) for any component.
116 File has a foreign (non-Lustre/free format) layout and is of the given
118 if specified. Presently only
122 are defined types, though 32-bit numeric types can also be used.
125 File has specified numeric group ID.
128 File belongs to specified group, numeric group ID allowed.
131 File has a layout of the given type, one of:
135 Traditional Lustre RAID-0 striping format.
138 HSM-archived files that are not resident in the filesystem.
141 Files that have the first data component on an MDT.
145 Use file size and blocks from MDT, if available, to avoid extra RPCs.
148 Limits find to decend at most \fIn\fR levels of directory tree.
150 .BR --mdt | --mdt-index | -m
151 File or directory inode is located on the specified MDT(s).
154 DNE striped directory uses the given filename hashing function, one of:
158 The CRUSH consistent hash function, added in Lustre 2.14, minimizes
159 entry migration if the directory stripe count changes during migration.
162 The Fowler\-Noll\-Vo hash function, which is a simple and efficient hash.
165 Simple hash function that sums all of the characters in the filename.
166 This is mostly for testing, or if it is known that filenames will use
167 sequential filenames.
171 The DNE striped directory has the given number of MDT shards.
173 .BR --mirror-count | -N
174 The file has \fIn\fR mirrors in its layout.
177 The file has a state of
181 is used, print only files not matching
183 Only one state can be specified. Valid state name is:
187 The mirrored file is in read-only state. All of the mirrors contain
191 The mirrored file is in a state of being written.
194 The mirrored file is in a state of being resynchronized.
198 File's data was last modified \fIn\fR*24 hours ago, see
200 for full details and options.
203 Filename matches the given filename, or regular expression using
206 file name regular expressions and wildcards.
208 .BR --newer [ XY "] " \fIreference
209 Succeeds if timestamp \fIX\fR of the file being considered is newer
210 than timestamp \fIY\fR of the file
212 The letters \fIX\fR and \fIY\fR can be any of the following letters:
220 a The access time of the file \fIreference\fR
221 b|B The birth time of the file \fIreference\fR
222 c The inode status change time of \fIreference\fR
223 m The modification time of the file \fIreference\fR
224 t \fIreference\fR is interpreted directly as a time
227 Some combinations are invalid; for example, it is invalid for
237 is interpreted directly as a time, currently it must be in one of the
238 following formats: "%Y-%m-%d %H:%M:%S", "%Y-%m-%d %H:%M", "%Y-%m-%d",
239 "%H:%M:%S", "%H:%M", to represent year, month, day, hour, minute, seconds,
240 with unspecified times at the start of that minute or day, unspecified dates
241 being "today", and "@%s" or "%s" the seconds since the Unix epoch (see
243 for details of the time formats). Otherwise, it will report an error.
244 If you try to use the birth time of a reference file, and the birth
245 time cannot be determined, a fatal error message results. If you
246 specify a test which refers to the birth time of files being examined,
247 this test will fail for any files where the birth time is unknown.
250 File has an object on the specified OST(s). The OST names can be specified
251 using the whole OST target name, or just the OST index number. If multiple
252 OSTs are given in a comma-separated list, the file may have an object on
253 any of the given OSTs. Specifying multiple OSTs allows scanning the
254 filesystem only once when migrating objects off multiple OSTs for evacuation
255 and replacement using
258 .BR "--perm \fImode\fR"
259 File's permission are exactly \fImode\fR (octal or symbolic).
261 .BR "--perm /\fImode\fR"
262 All of the permission bits \fImode\fR are set for the file.
264 .BR "--perm -\fImode\fR"
265 Any of the permission bits \fImode\fR are set for the file. If no permission
266 bits in \fImode\fR are set, this test matches any file.
269 Layout was created with the specified
271 name. For composite files, this may match the pool of any component.
273 Prints the file or directory name to standard output if it matches
274 all specified parameters, one file per line with a trailing linefeed.
275 This is the default behaviour for any matching files.
278 Print full file name to standard output if it matches the specified
279 parameters, followed by a NUL character. This is for use together with
283 option to handle filenames with embedded spaces or other special characters.
286 File has specified numeric project ID.
289 File size is \fIn\fR bytes, or \fBK\fRibi-, \fBM\fRebi-,
290 \fBG\fRibi-, \fBT\fRebi-, \fBP\fRebi-, or \fBE\fRbi-bytes if a
293 .BR --stripe-count | -c
294 File has \fIn\fR stripes allocated. For composite files, this
295 matches the stripe count of the last initialized component.
297 .BR --stripe-index | -i
298 File has stripe on OST index \fIn\fR. Multiple OST indices can be
299 specified in a comma-separated list, which indicates that the file
300 has a stripe on \fIany\fR of the specified OSTs. This allows a
301 single namespace scan for files on multiple different OSTs, if there
302 are multiple OSTs that are being replaced.
304 .BR --stripe-size | -S
305 Stripe size is \fIn\fR bytes, or \fBK\fRibi-, \fBM\fRebi-,
306 \fBG\fRibi-, \fBT\fRebi-, \fBP\fRebi-, or \fBE\fRbi-abytes if a
307 suffix is given. For composite files, this matches the stripe
308 size of the last initialized non-extension component.
310 .BR --extension-size | --ext-size | -z
311 Extension size is \fIn\fR bytes, or \fBK\fRibi-, \fBM\fRebi-,
312 \fBG\fRibi-, \fBT\fRebi-, \fBP\fRebi-, or \fBE\fRbi-abytes if a
313 suffix is given. For composite files, this matches the extension
314 size of any extension component.
317 File has type: \fBb\fRlock, \fBc\fRharacter, \fBd\fRirectory,
318 \fBf\fRile, \fBp\fRipe, sym\fBl\fRink, or \fBs\fRocket.
321 File has specified numeric user ID.
324 File owned by specified user, numeric user ID also allowed.
326 Specifying \fB!\fR before an option negates its meaning (\fIfiles
327 NOT matching the parameter\fR). Using \fB+\fR before a numeric
328 value means 'more than \fIn\fR', while \fB-\fR before a numeric value
329 means 'less than \fIn\fR'. If neither is used, it means 'equal to
330 \fIn\fR', within the bounds of the unit specified (if any).
332 Numeric suffixes are in binary SI (power-of-two) units.
334 For compatibility with
336 it is possible to specify long options with either a single or double
339 The order of parameters does not affect how the files are matched.
341 will first scan the directory for any specified filename, and then fetch
342 MDT inode attributes for each matching filename. If it can make a
343 positive or negative decision for a file based only on the MDT attributes
344 (e.g. newer than specified time, user/group/project ID) it will not fetch
345 the OST object attributes for that file.
348 .B $ lfs find /mnt/lustre
349 Efficiently lists all files in a given directory and its subdirectories,
350 without fetching any file attributes.
352 .B $ lfs find /mnt/lustre -mtime +30 -type f -print
353 Recursively list all regular files in given directory more than 30 days old.
355 .B $ lfs find /mnt/lustre/test -o OST0002,OST0003 -print0 | lfs_migrate -y
356 Recursively find all files in
358 that have objects on OST0002 or OST0003 and migrate them to other OSTs. See
362 .B $ lfs find -name "*.mpg" --component-count +3 /mnt/lustre
363 Recursively list all files ending with
365 that have more than 3 components.
367 .B $ lfs find --component-flags=init,prefer,^stale /mnt/lustre
368 Recursively list all files that have at least one component with both 'init'
369 and 'prefer' flags set, and doesn't have flag 'stale' set.
371 .B $ lfs find --mirror-count +2 /mnt/lustre
372 Recursively list all mirrored files that have more than 2 mirrors.
374 .B $ lfs find ! --mirror-state=ro /mnt/lustre
375 Recursively list all out-of-sync mirrored files.
377 .B $ lfs find ! --foreign=symlink /mnt/lustre
378 Recursively list all but foreign files/dirs of
384 command isn't as comprehensive as
386 In particular, it doesn't support complex boolean expressions with
388 (logical OR), only logical AND of all expressions. The order that parameters
389 are specified does not affect how the files are matched.
393 command is part of the Lustre filesystem.
396 .BR lfs-getstripe (1),
397 .BR lfs-getdirstripe (1),