Store the last X directories visited using cd in bash