To count only the lines in a file, you can use the wc (word count) command with the -l option. This option counts the number of lines in the specified file. Here’s how to use it:
wc -l filename.txt
This command will output the number of lines in filename.txt. If you want to count lines from the output of another command, you can pipe it into wc -l. For example:
cat filename.txt | wc -l
This will also give you the count of lines in the file.
