Ask HN: Small scripts, hacks and automations you're proud of?
This is more in the "hack" category, but here is a solution for bookmarking directories[1] that I am quite fond of:  mkdir ~/.marks/
  export CDPATH=.:~/.marks/
  function mark { ln -sr "$(pwd)" ~/.marks/"$1"; }

Then:  mark @name   # add bookmark called @name for the current directory
  cd @name     # jump to the bookmarked location
  cd @    # list all available bookmarks

It can list bookmarks, auto-complete, jump to sub-directories within bookmarks, all without introducing any new commands - just `cd`.[1]: http://karolis.koncevicius.lt/posts/fast_navigation_in_the_c...