Here's one possible solution:
alias ca='cd $(find . -maxdepth 1 -type d -printf "%T@ %p\n" | sort -n | tail -1 | cut -d" " -f2-)'
However,But it has the disadvantage offollowing problems:
- Using the output directly from
find
without using something likeprint0
, which results in directories with spaces in the name to not be handled correctly. - Entering
.
if that is the last modified directory, instead of one of the directories within.
.