Navigate to next and previous directory in tree, bash

alias nextdir='cd ../$(ls -1 .. | grep -A1 "^$(basename "$PWD")$" | tail -1)'
alias prevdir='cd ../$(ls -1 .. | grep -B1 "^$(basename "$PWD")$" | head -1)'

No comments: