I have a list of files(more than 300) with similar names. Example:
abc01, abc02, abc03…..
How can I find the number of times a specific word occurs in all these files in linux?
I have used this:
cat abc* | grep 20211203 | wc -l
Suppose i need to find a list of specific dates in the format yyyymmdd from these files and their counts, what should i include more?For example if there are value 20211203 is occuring 4 times and the value 20211202 is occuring 12 times and so on, is there a way to get the list of these value(like the format given below)?
4 20211203
12 20211202
.
.
. and so on
>Solution :
Try this:
cat abc* | grep -c word
where word is your word to be searched.