Linux – Showing the line count of a specific file

catcommand linegreplinux

Is this the correct way to show the line count of a specific file?

cat file | grep * -c

Best Answer

You can use this command:

wc -l <file>

This will return the total line number count in the provided file.

Related Question