wc -l file.txt

outputs number of lines and file name.

I need just the number itself (not the file name).

I can do this

 wc -l file.txt | awk '{print $1}'

But maybe there is a better way?

10 Answers
10

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *