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
Post a Comment