I'd like to know how I could delete all directories which are older than 14 days, without deleting their sub-folders.
I had been using the following command, but this will also check / delete all located sub-folders which are bound to their main directories:
find /path/ -mtime +14 -type d | xargs rm -f -r;
So it basically should only check if directories in /path/ are older than 14 days and delete them if so. My current command above does also check their sub-folders and delete those if older than 14 days, but it shouldn't check them - only the "main" folders in /path/.
Chris
find
man page? Possibly the-maxdepth
option is of interest. – larsks