GNU find's manpage says that all POSIX finds are supposed to detect filesystem loops and emit error messages in these cases, and I have tested
find . -follow -printf ""
on GNU find, which was able to find loops of the form ./a -> ./b and ./b -> ./a printing the error
find: `./a': Too many levels of symbolic links
find: `./b': Too many levels of symbolic links
(this also worked on a->b->c->a)
Likewise, loops of the form ./foo/x -> .. and ./foo/a -> ./bar + ./bar/b -> ./foo printed the errors
find: File system loop detected; `./foo/a/b' is part of the same file system loop as `./foo'.
find: File system loop detected; `./bar/b/a' is part of the same file system loop as `./bar'.
find: File system loop detected; `./foo/x' is part of the same file system loop as `.'.
If you wanted to do something with the output other than read it, you would need to redirect it from stderr to stdout and pipe it to some script that can parse out the error messages.
findcommand is either just printing.or not printing anything (so you are just runningls -lrtorls -lrt .) Don't know enough about HP-UXfindto tell you how to fix this (maybe it requires an explicit-print?). 2) What do you mean "circular"?./a -> ./band./b -> ./a? What about/home/foo/a -> /home? Or/home/foo/a -> /home/barand/home/bar/b -> /home/foo?-followactually give me some real links are results?-follow,findexamines the link itself, not the file it points to. Sofind . -type lprints things that are links (because they are-type l) without even looking to see what they point at (which would be files or directories or other links that pointed to files or directories).