Ubuntu server: Delete first folder in directory
- by Martin
How can I grab the first subfolder in a directory and delete it?
I found a script to monitor the free diskspace.
It sends an alert email if space runs low, but I want to also delete some unneeded stuff.
I have a backup folder where I save daily and monthly backups. I want to delete the first folder since this always the oldest, but I don't know the name of the oldest backup.
My folders without Jan-May and Dec:
06-01
07-01
08-01
09-01
10-01
11-01
Friday
Monday
Saturday
Sunday
Thursday
Tuesday
Wednesday
How can I delete the first folder "06-01" without knowing its name?