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


 description

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

 command

cat -b cmdhelp.txt 

 parameter

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

 result

     1  a
     2  b
     3  c
     4  d

     5  e

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.