Go to the most recently accessed directory matching "foo"

z

  • Tracks the most used (by frecency) directories and enables quickly navigating to them using string patterns or regular expressions.
    More information: <https://github.com/rupa/z>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

z -t {{foo}}

click the source code to copy install z on any operating system with command-not-found.com