Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to know number of lines in a file?

Status
Not open for further replies.

761210

IS-IT--Management
Jun 25, 2003
13
0
0
US
how do i know the lines within a file?
 
The above will count the number of lines in a file and give you the total. If you want to see a numbered list, try nl...

[root@penguin root]# nl somefile
1 line1
2 line2
3 line3
4 line4
5 line5


ChrisP
 
Also, if you have the file open in vi you can type :set nu to turn on numbering.

>---------------------------------------Lawrence Feldman
SR. QA. Engineer SNAP Appliance
lfeldman@snapappliance.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top