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:<p><pre><code>  mkdir ~/.marks/
  export CDPATH=.:~/.marks/
  function mark { ln -sr "$(pwd)" ~/.marks/"$1"; }
</code></pre>
Then:<p><pre><code>  mark @name   # add bookmark called @name for the current directory
  cd @name     # jump to the bookmarked location
  cd @<tab>    # list all available bookmarks
</code></pre>
It can list bookmarks, auto-complete, jump to sub-directories within bookmarks, all without introducing any new commands - just `cd`.<p>[1]: <a href="http://karolis.koncevicius.lt/posts/fast_navigation_in_the_command_line/" rel="nofollow">http://karolis.koncevicius.lt/posts/fast_navigation_in_the_c...</a>