I know how to exclude certain directories from
find <path> ! -path <path to exclude>. But this can be too tedious to type out when I need to exclude a lot of directories or simply cannot be used when the list of directories I need to exclude are not known ahead of time.
So, say I have a list of directories stored in a variable. Can I use
xargs to construct a
find command that excludes each of these directories? If so, how?