Following
https://askubuntu.com/questions/413529/delete-files-older-than-one-year-on-linux
and
sudo su -
cd /the/relevant/directory
find . -type f -printf '%s\n' | wc -l # for just the total number of files
find . -type f -mtime +365 -printf '%s\n' | wc -l # for the number of files older than a year
find . -type f -mtime +365 -printf '%s\n' | awk '{total=total+$1}END{print total/(1024*1024*1024)}' # total disk space used by files older than 365 days, in GB
No comments:
Post a Comment