I am writing a backup programm, and I need to execute a bash command to delete the oldest directory in a specific directory.
I have found this command to print the oldest directory:
find -type f -printf '%T+ %p\n' | sort | head -n 1
And this command to delete a directory and all its content:
rm -rf [oldest directory name]
How can I combine between these two in order to delete the oldest folder?