DU command - summary of files and folders
Hi guys,
I use the following command to find files which are older than 60 days: find /myfolder/* -mtime +60 > /myfolder/file.list Now I want to find out the file size of all files contained in file.list in summary using the du command: less /myfolder/file.list | xargs du -sh The du command prints the file sizes of every single file but not the summary and this is actually what I want. Does anyone have an idea? Thanks, |
If you read the manpage you'll see the -c option for a total.
|
interesting,
I think that du doesn't work on file list, but in the directory. Code:
find /mydir/* -mtime -60 | xargs du -hs otherwise "du" gives me: Code:
du /etc/postfix/ -hcs |
Damned!
I was so focused by the -s parameter that indeed doesn't work with the retrieving files from a file method... In addition, the command 'grep total' turns this in a nice piece of work I think:) less /myfolder/file.list | xargs du -csh | grep total I can work with that... thanks |
All times are GMT -5. The time now is 01:31 PM. |