I have a tree of directories, and I would like to archive the most recent directory at the last level (i.e, of the directories that don't contain subdirectories). Alternatively, I can rm the older directories and tar what's left. Maybe a picture would help:
Code:
d1
d2 d3
d4 d5 d6 d7
I want to archive whichever of d4 or d5 is more recent, and whichever of d6 and d7 is more recent. I don't care about d2 vs d3 or d4 vs d7.
I assumed some brilliant pattern to
find would do this, but if so it is far beyond my newbie skills.