Searching file or directory excluding NFS mounted file systems.

Sometimes I need to find a file or directory on my local machine and I don’t want to scan large NFS file systems connected to my machine.

I am using following syntax for do so:

$ find / -path /net -prune -o -type d -name *gcc*

This command line will search for any directory on my local machine with name included “gcc”. It will not search below “/net”.

You can add any number of “-path … -prune -o” in front of “-type” to add more directories to exclude from search. For example:

$ find / -path /net -prune -o -path /proc -prune -o -type d -name *gcc*

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

WP Like Button Plugin by Free WordPress Templates