Linux – List file count by Day

Posted By Sagar Patil
ls -lt | grep "^-" | awk '{
if($8 ~ /:/)
   $8=2011
Date_count=$6" "$7", "$8
freq[Date_count]++}
END {for (date in freq) printf "%s\t%d\n", date, freq[date] }' | sort

I often use this script when oracle archive volume fills up and I want to locate number of archive generated every day.

OUTPUT

Oct 1, 2011     3
Oct 2, 2011     3
Oct 3, 2011     4
Oct 4, 2011     24
Oct 5, 2011     48
Oct 6, 2011     101
Oct 7, 2011     39

 

 

Leave a Reply

You must be logged in to post a comment.

Top of Page

Top menu