I want to know how to get the number of rows in a text file using Linux. I have tried "wc " and "wc -l ", but both display only the number of lines (columns) not the rows. Any idea?
wc -l < <filename> displays lines for me
example file with numbers 1 - 7
outputs:
scottsmudger@ns207588:~ $wc -l < test
7
From the man page:
-l, --lines
print the newline counts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With