cli
Breadth-first search grep
· ☕ 1 min read · ✍️  Firmin Martin
Introduction From time to time, I want to search over my dotfiles, precisely those immediately under my home directory ~/. The problem of grep -R <regex> is that it quickly delves into an oceanic trench, full of caches, xml files or databases. In other words, it uses a depth-first approach. bfs-grep The following shell function helps me greatly to deal with such a situation. It employs a breadth-first search, i.e. level by level.