SEARCHFS(1)               BSD General Commands Manual              SEARCHFS(1)

NAME

     searchfs -- fast filename search on HFS+ and APFS volumes

SYNOPSIS

     searchfs [-dfespixnoh] [-v mount_point] search_term

DESCRIPTION

     searchfs searches for files by name on HFS+ and APFS volumes. Searching
     takes place at the driver level using the file system catalog via the
     low-level searchfs() kernel call. This means the volume's entire direc-
     tory tree can be scanned much faster than with a standard recursive
     directory search using /usr/bin/find.

     The paths to all files and directories with names matching the search
     term are printed to the standard output, one path per line. Search is
     case-insensitive by default.

     The following flags are supported:

     -l, --list
              List all mounted filesystems that support catalog search.

     -v, --volume path
              Specify volume to search, either by mount path (e.g. "/Vol-
              umes/SomeVol") or device name (e.g. "/dev/disk2s1"). Default is
              the root file system mounted at /.

     -d, --dirs-only
              Match directories only.

     -f, --files-only
              Match files only.

     -e, --exact-match
              Exact filename matches only.

     -s, --case-sensitive
              Case sensitive matching.

     -p, --skip-packages
              Don't match file system objects that are inside a package. A
              package is defined as a directory whose extension matches one of
              the extensions that are configured into the kernel by Launch
              Services.

     -i, --skip-invisibles
              Don't match invisible file system objects (that is, objects with
              the Finder attribute "Invisible" set) or any objects within
              invisible directories.

     -x, --skip-inappropriate
              Don't match any file system objects that are within an "inappro-
              priate" directory.  Apple's current list of inappropriate direc-
              tories contains one item: /System.

     -n, --negate-params
              Show all file system objects that do *not* match the search cri-
              teria.

     -m, --limit number
              Terminate when the specified number of matching items has been
              found.

     -o, --version
              Print program version and exit.

     -h, --help
              Print usage and exit.

EXAMPLES

     Find directories with name matching 'something' on root volume:

           searchfs -d something

     Find file with the exact name 'file.txt' on volume 'SomeHD':

           searchfs -v /Volumes/SomeHD -e file.txt

     The regular expression characters ^ and $ can be used to match only the
     beginning or only the end of a string, thusly:

     Find all filenames ending with suffix '.txt':

           searchfs '.txt$'

     Find all filenames starting with "CHANGES":

           searchfs ^CHANGES

SEE ALSO

     find(1), locate(1), mdfind(1), searchfs(2)

AUTHORS

     Sveinbjorn Thordarson <sveinbjorn@sveinbjorn.org>

Darwin                            Jun 7, 2019                           Darwin