There is no easy way to exclude mount points from the output of `find`.
The options -xdev or -mount prevent `find` from traversing over the
mount points but do not exclude the mount points themselves. It could
be scripted by AWK on Linux as in the following example:
$ find / -xdev -maxdepth 1 $(awk '$2 != "/" { printf("! -path %s ", $2) }'
/proc/mounts)
Would it make sense to introduce a new predicate similar to -samefile
that takes into account device numbers only?
With the proposed predicate implemented in `find`, the above command
could be encoded in a more user-friendly way:
$ find / -xdev -maxdepth 1 -samedev /
Originally reported at: https://bugzilla.redhat.com/1607772