I have a huge file vault (File directory) in Linux where files are added/modified daily, I want to find number of files & total size of files modified in last 30 days in Linux. How can I do it?
The find
command can find the files that have been modified (mtime) or created (ctime) within a certain amount of time. wc
can tell you the number of bytes in a group of files. xargs
converts words in the standard input into arguments to a command.
find /path/to/vault -mtime 29 -type f | xargs wc -c
find
is probably one of the most useful tools for helping to identify files that have properties of interest to you. I guarantee that taking the time to learn it will be time well spent.