We have robot results created into separate folders in format of "result-yyyy-mm-dd-hh-mm-ss" and I currently have this in my bash_aliases
alias res="VAR=$(ls --directory /path/to/results/res* | tail -n 1); cd $"
It works fine once.. then I have to reload my bashrc to make it work again. Tried baking the reload into a new alias but still had to use that 2-3 times before it switches to newer folder.