I did read the man page for xargs but i don't have the basis to compare it with |.
im sorry bout the thread title, i didn't know it wasn't allowed im a real newbie here.
Being new is no excuse. You have to accept the rules when you register. Accepting without reading them is your own fault and does not exempt you from following them.
On many modern versions of "find" the "+" syntax is actually fastest of all:
find . -type f -name '*.log' -exec grep "ERROR" \+
Addendum:
Sort of true. It does however exclude filenames starting with a period (e.g. .profile). It also sorts each directory to alphabetical order which is a bit of a waste if all you wanted to do was count them. It also gives an incorrect count if any filename contains a space character because you are counting "words". You also count directory files but because "including all subdirectories" is ambiguous it's hard to tell whether this is intentional.
This is a more efficient and accurate way to count every type of file (including directory files)
find . -print |wc -l
Or if your "find" allows the syntax:
find . | wc -l
Or if you just want to count all files:
find . -type f | wc -l