I have a directory, with thousands of files.
I need to sort the files in descending order of creation date (to make sure that the newest files wont be deleted), and start summing the size of these files until the summation reaches a certain limit (example 10GB).
Once that is reached, I need to be able to delete all the files (that are already sorted in descending order), that come after those 10GB of files.
So, after the operation, the contents of my directory should not exceed 10GB in total size, but the newest files must remain.
I need to be able to accomplish this without the usage of GAWK since I don't have GNU system.
Is this doable with the
find command only?