cancel
Showing results for 
Search instead for 
Did you mean: 
Trevor
Starfighter Starfighter
Starfighter
  • 19 Views

Line Count

Ways to get a count of the number of lines in a file:

1. Using the "wc" command

              $ wc -l  <filename>

 

2. Using "awk"

              $ awk 'END{ print NR }'  <filename>

 

3. Using "sed"

              $ sed -n \$=   <filename>

 

 

Just a little appetizer - nothing heavy!

 

Trevor "Red Hat Evangelist" Chandler
0 Kudos
0 Replies
Join the discussion
You must log in to join this conversation.