How can I recursively count files in a Linux directory?
I found this:
find DIR_NAME -type f | wc -l
or see example below: " Found 187550 files in the directory /var/*
Write a command that will do the following:
-look for all files in the current and subsequent directories with an extension c,v
-strip the,v from the result (you can use sed command)
-use the result and use a grep command to search for all occurrences of the word ORANGE in the files.
# find ./ -name “*.c,v” | sed ‘s/,v//g’ | xargs grep “ORANGE”