How to get lines count from file in Linux.

Get file row count from Linux

# Simple version
less /var/log/mylog.log | wc -l

Here is if you want the occurence of something

# Simple version
less /var/log/mylog.log | grep 'searc something' |  wc -l
Back