find / grep command without searching mounted shares

If you're using GNU find (as is used on most Linux systems), you'll want to use -mount:

find / -mount -name .vimrc

OS X/MacOS provides the local psuedo-fstype. This not in GNU find (fstypes recognized by GNU find).

Use the -fstype local option to find on MacOS:

find / -fstype local -name .vimrc

If you want to exclude only specific paths, you could use -prune:

find / -name /path/to/ignore -prune -o -name .vimrc

man find shows:

-xdev Don't descend directories on other filesystems.

Tags:

Linux

Grep

Find