Hacker News new | ask | show | jobs
by jandrese 3164 days ago
Probably not exactly what you want, but the pushd/popd/dirs commands have existed in all major shells forever.

You can run dirs -v to get the list, and do cd +(num) to go there.

So:

  FreeBSD <jubei/pts/2> (219 /var): dirs -v
  0	/var
  1	/usr/local
  2	~
  FreeBSD <jubei/pts/2> (220 /var): cd +1
  /usr/local
  FreeBSD <jubei/pts/2> (221 /usr/local): _