I want to find the oldest directory (inside the directory) and delete it. I am using the following:
rm -R $(ls -1t | tail -1)
ls -1t | tail -1 ls -1t | tail -1 really gives me the oldest directory, the problem is that it does not delete the directory and that it also lists files.
How can i fix this?
bash directory file-io delete-directory
Jary
source share