Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 18 down vote accepted

Use the -fstype local option to find:

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


The local psuedo-fstype is available in the version of find that comes with OS X, but is not in GNU find (fstypes recognized by GNU find).

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

find / -mount -name .vimrc
share|improve this answer
does that work for grep too? – Flotsam N. Jetsam Jan 5 '11 at 15:36
I don't think grep has such an option. I usually used find pipe to grep as shown in this answer:… . Lately, I've been using ack ( instead, but ack doesn't seem to have an option to search only local drives. – Doug Harris Jan 5 '11 at 15:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.