Good day
Probably a simple script though I am new to attempting to script. I have a directory that I would like to get the size of the files and number of files for each date
ie 14 Sep 669 files 1.8g
12 Sep 221 files 500mb
Any ideas?
Thanks
Good day
Probably a simple script though I am new to attempting to script. I have a directory that I would like to get the size of the files and number of files for each date
ie 14 Sep 669 files 1.8g
12 Sep 221 files 500mb
Any ideas?
Thanks
Generally speaking, you can take the output of an:
ls -ltr /your/path
and parse that in perl or awk. You can use shell scripting too, but for me personally, I would use perl to create a record with hash variables that will track the file count and the cumulative size of all files for each date.
The '-r' option on the ls command is optional, it just reverses the sense of the listing, so you get oldest files at the top of the listing and the newest files at the bottom. Otherwise you'll get newest at the top and oldest at the bottom.