Hi,
I want to display the file names and the record count for the files in the 2nd column for the files created today.
i have written the below command which is listing the file names. but while piping the above command to the wc -l command
its not working for me.
ls -l --time-style='+%d/%m/%Y' | grep '06/05/2014' | awk '{print $7}'
Need suggestion to get the file name and record count of the files.
Thanks
try
for file in $(ls -ltr | grep "May 6" | awk '{print $9}');
do
rc=`cat $file | wc -l`
echo $file $rc
done
Thanks so much . But i want it in a command not using script. if possible.
RudiC
May 6, 2014, 8:56am
4
How about
find . -type f -mtime -1 -exec wc -l {} +
Thanks a lot Rudic. Its almost satisfied my requirement But along with the files created today it is also listing one more file which was created one day before.
Anyway thanks. I will explore more on -mtime and will get the solution.
Thanks for your time.
RudiC
May 7, 2014, 10:20am
6
Look into -mmin as well, and -daystart if available on your system.