I am trying to figure out how to apply a Python function to the oldest 50% of the sub-folders inside my parent directory.
For instance, if I have 12 folders inside a directory called foo
, I'd like to sort them by modification date and then remove the oldest 6. How should I approach this?