You should be able to do this with a couple of shell functions and a temporary file.
Your temporary file will be called as " /home/me/.directory_stack" and will simply contain a list of directories:
/home/me
/etc
/var/log
'push_directory' . "pop_directory" . , ( ).
(: )
directory_stack=/home/me/.directory_stack
function push_dir() {
echo $(pwd) >> $directory_stack
cd $1
}
function pop_dir() {
[ ! -s $directory_stack ] && return
newdir=$(sed -n '$p' $directory_stack)
sed -i -e '$d' $directory_stack
cd $newdir
}
.bashrc, .