Shell script for search in BTRFS filesystem (exclude snapshots)

Don’t use path.

Try this:

find . -type d -name '.snapshots' -prune -o -name ${argument}

Although, to be honest, since the snapshots are generally only readable by root unless you are using sudo with your find command they should not be found anyway.

2 Likes