4

Often I go looking for something and resort to running find / -name ... But when there are multiple network drives mounted it can take forever.

There doesn't appear to be any parameter to restrict it to a physical disc/volume. Is there any way to do this?

John Mee
  • 953
  • 1
  • 8
  • 18

1 Answers1

8

You can instruct find to never cross a filesystem boundary. From man find:

-xdev  Don't descend directories on other filesystems.

However, this does not distinguish between filesystems on the network and on local physical drives.

Note that this means:

  • find / -xdev ... will not, for example, go into /proc
  • but find /* -xdev will.

This is because the "other filesystems" check is done with respect to the paths that were given as arguments.

muru
  • 197,895
  • 55
  • 485
  • 740