When you run the find command on the root directory of a system you may want to exclude all network filesystems and confine your search to only your local machine. The benefits of this are obvious as it will save you a great amount of time especially if the mounted filesystem is very large.
Luckily the find command provides this ability with the ‘-xdev‘ or ‘-mount‘ options.
For example:
$ find / -xdev -name myfile.txt
This command will recursively search for myfile.txt starting in your root directory and skip all externally mounted filesystems.
Comments (1)
on June 17, 2011 at 3:11 pm
Not quite. The -xdev option will skip ALL other filesystems, not just NFS. If you have multiples disks/filesystems mounted somewhere in /, you wont check them.
Trackbacks (0)