Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Both solutions works well. I like yours also because I can see per file the count Commented Jun 3, 2022 at 11:57
  • 1
    @thanasisp, grep would print lines like hello.txt:1, foo.txt:3 if it's given multiple filenames. cat *.log | grep ... would give the total, though Commented Jun 3, 2022 at 12:04
  • I used this: grep -vc '^.\{301\}' *.log | awk -F: '{s+=$2} END {print s}' , but in case if you need per file the count: grep -vc '^.\{301\}' *.log > 300grep.txt and then awk Commented Jun 3, 2022 at 12:24
  • I have ~ 60GB of logs to search in Commented Jun 3, 2022 at 12:25