Breadth-first variant of the UNIX find command that searches directories level-by-level instead of depth-first
bfs is a file search tool that implements the UNIX find command interface while using breadth-first traversal instead of depth-first. This traversal strategy often finds target files faster by searching shallow directories before exploring deep nested structures. The tool maintains compatibility with POSIX, GNU, FreeBSD, OpenBSD, NetBSD, and macOS versions of find.
The tool includes several usability improvements over standard find implementations. It accepts arguments in flexible order, provides helpful error messages with typo detection, and includes static analysis to catch expression mistakes. bfs also adds extensions like the -exclude operator for skipping entire subtrees and -nohidden for ignoring hidden files, which simplify common search patterns compared to traditional find syntax.
bfs targets users who frequently search filesystems and want faster results on typical directory structures. System administrators, developers, and anyone working with large directory trees would benefit from its breadth-first approach, especially when searching for files likely to be in shallow locations rather than deeply nested paths.
# via Homebrew
brew install bfs
# via APT
apt install bfs
# via DNF
dnf install bfs