Skip to main content
6 of 7
deleted 6 characters in body
thanasisp
  • 8.5k
  • 2
  • 29
  • 40

With grep:

cat *.log | grep -vc '^.\{301\}'

To match lines with length <=300 we grep with -v (invert match) for any 301 characters, as the search pattern is limited to one line for grep. Pattern is anchored at the beginning of the line with ^. And -c counts the matching lines.


If you want to have some basic progress indicator, you can use pv from package moreutils:

pv *.log | grep -vc '^.\{301\}'
thanasisp
  • 8.5k
  • 2
  • 29
  • 40