Scroll to navigation

FD(1) General Commands Manual FD(1)

NAME

fd - find entries in the filesystem

SYNOPSIS

fd [-HIEsiaLp0hV] [-d depth] [-t filetype] [-e ext] [-E exclude] [-c when] [-j num] [-x cmd] [pattern] [path...]

DESCRIPTION

fd is a simple, fast and user-friendly alternative to find(1).

OPTIONS

Include hidden files and directories in the search results (default: hidden files and directories are skipped).
Show search results from files and directories that would otherwise be ignored by .gitignore, .ignore or .fdignore files.
Show search results from files and directories that would otherwise be ignored by .gitignore files.
Perform a case-sensitive search. By default, fd uses case-insensitive searches, unless the pattern contains an uppercase character (smart case).
Perform a case-insensitive search. By default, fd uses case-insensitive searches, unless the pattern contains an uppercase character (smart case).
Treat the pattern as a literal string instead of a regular expression.
Shows the full path starting from the root as opposed to relative paths.
By default, fd does not descend into symlinked directories. Using this flag, symbolic links are also traversed.
By default, the search pattern is only matched against the filename (or directory name). Using this flag, the pattern is matched against the full path.
-0, --print0
Separate search results by the null character (instead of newlines). Useful for piping results to xargs.
Enable the display of filesystem errors for situations such as insufficient permissions or dead symlinks.
Print help information.
Print version information.
Limit directory traversal to at most d levels of depth. By default, there is no limit on the search depth.
Filter search by type:
regular files
directories
symbolic links
executable (files)
empty files or directories

This option can be used repeatedly to allow for multiple file types.
Filter search results by file extension ext. This option can be used repeatedly to allow for multiple possible file extensions.
Exclude files/directories that match the given glob pattern. This overrides any other ignore logic. Multiple exclude patterns can be specified.
Add a custom ignore-file in '.gitignore' format. These files have a low precedence.
Declare when to colorize search results:
Colorize output when standard output is connected to terminal (default).
Do not colorize output.
Always colorize output.
Number of threads to use for searching (default: number of available CPUs).
Limit results based on the size of files using the format <+-><NUM><UNIT>
'+'
file size must be greater than or equal to this
'-'
file size must be less than or equal to this
'NUM'
The numeric size (e.g. 500)
'UNIT'
The units for NUM. They are not case-sensitive. Allowed unit values:
'b'
bytes
'k'
kilobytes
'm'
megabytes
'g'
gigabytes
't'
terabytes
'ki'
kibibytes
'mi'
mebibytes
'gi'
gibibytes
'ti'
tebibytes
Filter results based on the file modification time. The argument can be provided as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). --change-newer-than can be used as an alias.

Examples:
--changed-within 2weeks
--change-newer-than "2018-10-27 10:00:00"

Filter results based on the file modification time. The argument can be provided as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). --change-older-than can be used as an alias.

Examples:
--changed-before "2018-10-27 10:00:00"
--change-older-than 2weeks

Execute command for each search result. The following placeholders are substituted by a path derived from the current search result:
{}
path
{/}
basename
{//}
parent directory
{.}
path without file extension
{/.}
basename without file extension
Execute command with all search results at once. A single occurence of the following placeholders is authorized and substituted by the paths derived from the search results before the command is executed:
{}
path
{/}
basename
{//}
parent directory
{.}
path without file extension
{/.}
basename without file extension

ENVIRONMENT

Determines how to colorize search results, see dircolors(1).

EXAMPLES

Find files and directories that match the pattern 'needle':
$ fd needle
Start a search in a given directory (/var/log):
$ fd nginx /var/log
Find all Python files (all files with the extention .py) in the current directory:
$ fd -e py
Open all search results with vim:
$ fd pattern -X vim

SEE ALSO

find(1)