I have these functions in my .bashrc
addpi() { echo "cd `pwd` $1" >> ~/.pi; echo }
pi() { `cat ~/.pi | grep $1`; }
Usage: when you are in a dir that you want to bookmark say addpi <name>
when you want to return to that dir from anywhere say pi <name>
Ofcourse you need some kind of resolution if you have 2 matches in the grep, but it works for me.