1FD(1) General Commands Manual FD(1)
2
3
4
6 fd - find entries in the filesystem
7
9 fd [-HIEsiaLp0hV] [-d depth] [-t filetype] [-e ext] [-E exclude] [-c
10 when] [-j num] [-x cmd] [pattern] [path...]
11
13 fd is a simple, fast and user-friendly alternative to find(1).
14
16 -H, --hidden
17 Include hidden files and directories in the search results
18 (default: hidden files and directories are skipped).
19
20 -I, --no-ignore
21 Show search results from files and directories that would other‐
22 wise be ignored by .gitignore, .ignore or .fdignore files.
23
24 -u, --unrestricted
25 Alias for '--no-ignore'. Can be repeated; '-uu' is an alias for
26 '--no-ignore --hidden'.
27
28 --no-ignore-vcs
29 Show search results from files and directories that would other‐
30 wise be ignored by .gitignore files.
31
32 -s, --case-sensitive
33 Perform a case-sensitive search. By default, fd uses case-insen‐
34 sitive searches, unless the pattern contains an uppercase char‐
35 acter (smart case).
36
37 -i, --ignore-case
38 Perform a case-insensitive search. By default, fd uses case-
39 insensitive searches, unless the pattern contains an uppercase
40 character (smart case).
41
42 -g, --glob
43 Perform a glob-based search instead of a regular expression
44 search.
45
46 --regex
47 Perform a regular-expression based seach (default). This can be
48 used to override --glob.
49
50 -F, --fixed-strings
51 Treat the pattern as a literal string instead of a regular
52 expression.
53
54 -a, --absolute-path
55 Shows the full path starting from the root as opposed to rela‐
56 tive paths.
57
58 -L, --follow
59 By default, fd does not descend into symlinked directories.
60 Using this flag, symbolic links are also traversed.
61
62 -p, --full-path
63 By default, the search pattern is only matched against the file‐
64 name (or directory name). Using this flag, the pattern is
65 matched against the full path.
66
67 -0, --print0
68 Separate search results by the null character (instead of new‐
69 lines). Useful for piping results to xargs.
70
71 --show-errors
72 Enable the display of filesystem errors for situations such as
73 insufficient permissions or dead symlinks.
74
75 --one-file-system, --mount, --xdev
76 By default, fd will traverse the file system tree as far as
77 other options dictate. With this flag, fd ensures that it does
78 not descend into a different file system than the one it started
79 in. Comparable to the -mount or -xdev filters of find(1).
80
81 -h, --help
82 Print help information.
83
84 -V, --version
85 Print version information.
86
87 -d, --max-depth d
88 Limit directory traversal to at most d levels of depth. By
89 default, there is no limit on the search depth.
90
91 -t, --type filetype
92 Filter search by type:
93
94 f, file
95 regular files
96
97 d, directory
98 directories
99
100 l, symlink
101 symbolic links
102
103 x, executable
104 executable (files)
105
106 e, empty
107 empty files or directories
108
109 This option can be used repeatedly to allow for multiple file
110 types.
111
112 -e, --extension ext
113 Filter search results by file extension ext. This option can be
114 used repeatedly to allow for multiple possible file extensions.
115
116 -E, --exclude pattern
117 Exclude files/directories that match the given glob pattern.
118 This overrides any other ignore logic. Multiple exclude pat‐
119 terns can be specified.
120
121 --ignore-file path
122 Add a custom ignore-file in '.gitignore' format. These files
123 have a low precedence.
124
125 -c, --color when
126 Declare when to colorize search results:
127
128 auto Colorize output when standard output is connected to ter‐
129 minal (default).
130
131 never Do not colorize output.
132
133 always Always colorize output.
134
135 -j, --threads num
136 Set number of threads to use for searching & executing (default:
137 number of available CPU cores).
138
139 -S, --size size
140 Limit results based on the size of files using the format
141 <+-><NUM><UNIT>
142
143 '+' file size must be greater than or equal to this
144
145 '-' file size must be less than or equal to this
146
147 'NUM' The numeric size (e.g. 500)
148
149 'UNIT' The units for NUM. They are not case-sensitive. Allowed
150 unit values:
151
152 'b' bytes
153
154 'k' kilobytes
155
156 'm' megabytes
157
158 'g' gigabytes
159
160 't' terabytes
161
162 'ki' kibibytes
163
164 'mi' mebibytes
165
166 'gi' gibibytes
167
168 'ti' tebibytes
169
170 --changed-within date|duration
171 Filter results based on the file modification time. The argument
172 can be provided as a specific point in time (YYYY-MM-DD
173 HH:MM:SS) or as a duration (10h, 1d, 35min). --change-newer-
174 than can be used as an alias.
175
176 Examples:
177 --changed-within 2weeks
178 --change-newer-than "2018-10-27 10:00:00"
179
180 --changed-before date|duration
181 Filter results based on the file modification time. The argument
182 can be provided as a specific point in time (YYYY-MM-DD
183 HH:MM:SS) or as a duration (10h, 1d, 35min). --change-older-
184 than can be used as an alias.
185
186 Examples:
187 --changed-before "2018-10-27 10:00:00"
188 --change-older-than 2weeks
189
190 -x, --exec command
191 Execute command for each search result. The following placehold‐
192 ers are substituted by a path derived from the current search
193 result:
194
195 {} path
196
197 {/} basename
198
199 {//} parent directory
200
201 {.} path without file extension
202
203 {/.} basename without file extension
204
205 -X, --exec-batch command
206 Execute command with all search results at once. A single
207 occurence of the following placeholders is authorized and sub‐
208 stituted by the paths derived from the search results before the
209 command is executed:
210
211 {} path
212
213 {/} basename
214
215 {//} parent directory
216
217 {.} path without file extension
218
219 {/.} basename without file extension
220
222 The regular expression syntax used by fd is documented here:
223
224 ⟨https://docs.rs/regex/1.0.0/regex/#syntax⟩
225
226 The glob syntax is documented here:
227
228 ⟨https://docs.rs/globset/#syntax⟩
229
231 LS_COLORS
232 Determines how to colorize search results, see dircolors(1).
233
235 Find files and directories that match the pattern 'needle':
236 $ fd needle
237
238 Start a search in a given directory (/var/log):
239 $ fd nginx /var/log
240
241 Find all Python files (all files with the extention .py) in the current
242 directory:
243 $ fd -e py
244
245 Open all search results with vim:
246 $ fd pattern -X vim
247
249 find(1)
250
251
252
253 FD(1)