cdコマンドの履歴で”戻る/進む”機能を実装

cdコマンドの履歴で”戻る/進む”機能を実装する3行のAlias #Linux - Qiitaより

alias b='if [[ $l -le 1 ]]; then l=1; if [[ $f2 -eq 1 ]]; then f2=;if [ "$la" != "$PWD" ]; then h=$PWD:$h;la=$PWD;fi;fi;fi;((l=l+1));f=1;cd'
alias f='f=1;if [[ $l -le 1 ]]; then l=1;f=;else ((l=l-1));cd;fi'
alias cd='((l2=l+1));if [[ $f -eq 1 ]];then f=;t=`echo $h|cut -f$l -d:`;else f2=1;if [ "$la" != "$PWD" ]; then h=$PWD:`echo $h|cut -f$l2- -d:`;la=$PWD;fi;l=0;t=;fi;cd $t'