How do you show the number of lines in a file in Linux


View the content of cmdhelp.txt in Linux, and number non-blank lines


cat -b cmdhelp.txt 


cat : Concatenate FILE(s) to standard output.
-b, --number-nonblank : number nonempty output lines, overrides -n


     1  a
     2  b
     3  c
     4  d

     5  e
Was this helpful?

I hope to help every developer quickly find the commands they need. Of course, you can also add your own commonly used commands for easy searching.