I'm trying to write a cross-platform command line that will find all local files on a file system.
My intention is to use the
find command, using only POSIX parameters. Is there a way to skip files on remote filesystems, while restricted to only POSIX commands, and no programming?
My current command line is
find -type f -print
but that obviously lists every regular file, not just local ones.
I am aware of the
-local flag, but as far as I can tell, it's not POSIX or otherwise part of a cross-platform standard.
locate doesn't appear to be cross-platform either. I don't think the
-xdev flag is what I'm looking for, either, as I want to search across all locally mounted file systems - if
/home are both local, and I run
find / -xdev -print,
find should skip
/home (unless I'm misunderstanding stuff).
For what it's worth, the following URLs have been useful resources...