Home

Awesome

FD

fd, for "find directory", is a variant on the "cd" command that will seach for directory names in a "directory path". This works very similar to the $PATH environment variable that is searched whenever a program is executed from the shell.

Usage

See Installation for more details. Note that fd-suggest only outputs the suggestion to the terminal; you must manually alter the $FDPATH in your fdrc file to persist it.

Passive Behavior

When fd.sh is sourced during shell startup, it will change the current working directory back to the location it was previously at the last time the window was open (as identified by the tty). This is useful in conjunction with the history-recall project, especially after a system restart on MacOS, when multiple terminal windows are restored.

Installation

$ cd $HOME/persistent/install/location
$ git clone https://github.com/g1a/fd.git
$ cd fd
$ source fd-install.sh --with-cdd

The fd-install.sh script will create a $HOME/.fdrc file that sources fd.sh in the location it was installed to. The initial rc file will include an export of $FDPATH with locations provided by the fd-suggest function. Edit $FDPATH to suit your preferences.

The --with-cdd option will cause the installer to also install the cdd project, which provides a more robust implementation of the .. function.

About

The fd command was added to the Utiliscripts project in 2015. The goal was to allow for projects to be organized hierarchically in the filesystem without requiring that the installation paths be memorized. It now exists in its own project to make it easier to install without taking on everything provided by Utiliscripts.

Alternate Solutions