linux - Counting lines starting with a certain word -
how count number of lines in text file starting word?
i not want use sed
, wc -l
. better solution?
try this:-
awk '/^yourwordtofind/{a++}end{print a}' file
how count number of lines in text file starting word?
i not want use sed
, wc -l
. better solution?
try this:-
awk '/^yourwordtofind/{a++}end{print a}' file
Comments
Post a Comment