When I used the find command, I almost always need to search the local drives. But, I almost always have super large network shares mounted and these are included in the search. Is there an easy way to exclude those in the find command, grep and other similar commands? Example:
find / -name .vimrc
Best Answer
If you're using GNU find (as is used on most Linux systems), you'll want to use
-mount
:OS X/MacOS provides the
local
pseudo-fstype. This not in GNU find (fstypes recognized by GNU find).Use the
-fstype local
option to find on MacOS:If you want to exclude only specific paths, you could use
-prune
: