Link to home
Start Free TrialLog in
Avatar of mikesteven
mikesteven

asked on

file size

Hi,

How can I get the file size of all the files starting feb 2, 2011 up to feb 8, 2011?

Cheers!
Avatar of alphabet26
alphabet26

as a sum of the file sizes or just display them?
Try this:
find . -maxdepth 1 -type f  -newermt "2011-02-02 00:00" ! -newermt "2011-02-07 23:59" -exec /usr/bin/du -ch {} +

Open in new window


you might need to change the path to du (which du) to find it.
Avatar of mikesteven

ASKER

yes please, as a sum
The sum is at the bottom of the output of the command I gave. It may not work if there are too many matching files though as it passes them all as arguments to du and you might run into the maximum command line length.

Remove the -maxdepth 1 if you want to look in subdirectories too.
Tomun, there's gonna be like 6,000 files matching will that work?
ASKER CERTIFIED SOLUTION
Avatar of Tomun
Tomun
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial