linux - How to only get the number of lines of a file -


how number of lines of file in linux?

i want number of lines, not filename.
want in single command, without grep or utility.

wc -l sample.txt    

output

5 sample.txt 

desired output

5 

try this

wc -l < sample.txt 

wc doesn't print out filename if reads file through standard input. < feeds file via standard input.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -