SEARCHFS(1)                 General Commands Manual                SEARCHFS(1)

NAME

     searchfs – fast filename search on HFS+ and APFS volumes

SYNOPSIS

     searchfs [-ldfespinmoh] [-v mount_point/device_namelist_volumes]
              search_term

DESCRIPTION

     searchfs searches for files by name on APFS and HFS+ 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
     directory 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.
              "/Volumes/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.

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

     -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, respectively.

     For example, find all filenames ending with the suffix '.txt':

           searchfs '.txt$'

     Find all filenames starting with "CHANGES":

           searchfs -s ^CHANGES

     Find *all* files on the root filesystem:

           searchfs *

SEE ALSO

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

AUTHORS

     Sveinbjorn Thordarson <sveinbjorn@sveinbjorn.org>

Darwin                           May 16, 2025                           Darwin