Fast command-line navigation, automatic bookmarking, and referencing using fasd

One of my favorite recent productivity discoveries is fasd at https://github.com/clvv/fasd. It lets you easily jump to directories that you visit frequently.

For example, I have a directory named “caffe-help-barebones” as well as “caffe-help-git” and other “caffe-help-*” directories. Regardless of the current directory, I can jump to it by using z caffe-help-barebones, or by just referencing a unique part of the directory name: z barebones.

Installation

Installing is very easy, which is nice since I quickly wanted to install it on all of my Linux systems. There are additional methods available listed on the website. I prefer to avoid PPAs or installing these types of applications system-wide. If you prefer to use these methods, see: https://github.com/clvv/fasd/wiki/Installing-via-Package-Managers.

I use the following to install:

sudo apt-get install build-essentials pandoc

mkdir -p ~/.local/install
mkdir -p ~/.local/bin
cd ~/.local/install
git clone git@github.com:clvv/fasd.git fasd-git
cd fasd-git
make all
PREFIX=~/.local make install

Your bashrc should run eval "$(fasd --init auto)". If you want to include it in all of your bashrc’s, even on systems that might not have fasd installed, you can run the following:

echo -e '\nif command -v fasd; then\n  eval "$(fasd --init auto)"\nfi' >> ~/.bashrc

Which appends the following to your .bashrc:

if command -v fasd; then
  eval "$(fasd --init auto)"
fi