Typically when you execute 'du -h' you get a listing of all the files in the directory and subdirectories and a total usage at the bottom. I am trying to get the total usage from all the files in several directories. I have tried the following:
Code:
find /home/httpd/vhosts/*/httpdocs/userfiles -ctime +30 -daystart -exec /usr/bin/du -sh '{}' \;
and
Code:
find /home/httpd/vhosts/*/httpdocs/userfiles -ctime +30 -daystart -type d | xargs du -sh | sort -n
Both return virtually the same thing, but no total at the bottom. What I'm trying to accomplish is to give someone an idea of how much space will be cleared up by deleting all the files older than 30 days before I use
-exec rm'{} \; with find.