Introducing how to exclude folders and directories in the find command of the Linux Bash command line.
For example, if you want to exclude the ./misc folder/directory, use ./misc -prune -o. Hereโs an example:
find . -path ./misc -prune -o -name '*.txt' -print
Here is an example with multiple directories:
find . -type d \( -path dir1 -o -path dir2 -o -path dir3 \) -prune -o -print