I recently read How to find the total number of occurrences of text and files with find command, which asked about a way to find the number of times text "abc" appears in a file. The answer there provided the command
find . -name "*.txt" | xargs grep -i "abc" | wc -l to find the count.
Previously I have used something like
more "file_name*" |grep "abc" |wc -l to list the number if times text "abc" appears in a specific file(s).
I tried this and found that the
more command returned faster, but seemed to use ~30% more CPU (I was also monitoring via
top) than the
I was wondering if anyone had some more solid data on which of these two commands would be more intensive on resources if you were to query through approximately 15 files? How about 30+ files?