17
4
Say I need to do:
find / -name somefile.txt
and say root partition /
is mounted on /dev/sda5
; however, let's say I also have 250GB partitions (/dev/sda6
, /dev/sda7
) mounted in /media
- AND another location that I cannot currently remember. Say, also, that I know the file I'm looking for is on /dev/sda5
.
Obviously, the above command will also descend in /media
and that other directory which represent the big partitions, wasting time in looking for the file in the wrong place.
Is there a way to instruct find (or other command) to search only /
on /dev/sda5
, and NOT to descend to directories if they are on different partitions?
1Thanks much - just for reference, the syntax would be:
<pre>find / -xdev -name somefile.txt</pre> – sdaau – 2010-06-11T13:43:46.103
1Searching the manpage for
--one-file-system
a ladu
did me no good either. At least they both begin with-x
I suppose. And it means "cross devices" I think. – Sridhar Sarnobat – 2018-06-01T00:16:38.9671For mac users: find -x / -name somefile.txt – CodeReaper – 2014-01-31T09:58:29.267