In my previous question In find -exec, how to substitue current file by {}?, I have asked about test with find.
I want to find all files I do not own.
So there is proper find command:
find . -type f ! -user "$USER"
but so should be this one as well:
find . -type f -exec bash -c '
for pathname do
[[ ! -O "$pathname" ]] && printf "%s\n" "$pathname"
done' bash {} +
yet both gives different results .
1) if I do [command one] | wc -c --> 4121
But: [command two] | wc -c --> 236768
(PS: I am searching files in my $HOME).
Both gives different numbers of how many files they found.
2) Both still give in result files, that are directories (yes, directories I do not own and thus - permission denied). They give directories despite having find . -type f type files (not dirs) in argument of option, why? (When I ls -ld one of those directory, none is link or anything else)