Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Funnily enough, I did the exact same thing but for zsh's two-argument cd:

  cd() { if [[ -n "$2" && "$1" != "--" ]]; then builtin cd "${PWD/"$1"/"$2"}"; else builtin cd "$@"; fi; };
It's niche functionality, but super useful when you hit its niche:

  user@machine:/usr/src/linux-kbuild-4.9/scripts/mod$ cd 4.9 4.8
  user@machine:/usr/src/linux-kbuild-4.8/scripts/mod$ 
I'll leave combining these two as an exercise for the reader.


Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: