1

quickest way to get the total number of lines in a file

view story
linux-howto

http://www.unix.com – i have a file that's about 2GB, i have to get the total number of lines in this file every 10 minutes. the interval is not an issue. i just need the proper, most efficient way to do this. any ideas? i got the following from another thread on this site, but: Code: awk 'int(100*rand())%5<1' file but this randomly pulls out 20% of lines in a file. i'm thinking this code can be slightly modified to get what i want? (HowTos)