hi all
plz some unix guy help me in this
i have 60 files which will have some records
i want to find the total number of records in all the 60 files
like file1 has 60 and file2 has 70 record
i want to sum all these and find total row count in 60 files
Can u show the contents of some of the files:
each file will have records
like
2 abc abc
3 abc dfg
4 abc gfh
now like this we have 60 files .i take sum of row count of all these 60 files
and sum it up
plz tell me how to do it
kesari
4
Use word count (wc) command. wc -l file_name.
r u putting this in a script or direct calculating from command prompt?
try this
#! /bin/sh
for i in `ls -1tr`
do
wc -l $i
done
this will give you the number of records in every file.
-----------
if you want to find total number just use
cat * | wc -l
Best Regards