wc -l < path/to/file
wc -l path/to/file
prints the number of lines in the specified file, and also the file path, for example if /etc/resolv.conf
has 4 lines in it, then the output of wc -l /etc/resolv.conf
would be:
4 /etc/resolv.conf
wc -l < path/to/file
uses input redirection (the <
operator) to pass the content of a file to wc
on standard input, without the filename, and the output this way will be simply:
4