For windows Command line: for %G in (*.sql) do find /c /v "_+_" %G For linux Command Line: wc -l *.sh