Fasd

Command-line productivity booster, offers quick access to files and directories, inspired by autojump, z and v.

Fasd

Fasd (pronounced similar to “fast”) is a command-line productivity booster. Fasd offers quick access to files and directories for POSIX shells. It is inspired by tools like autojumpz and v. Fasd keeps track of files and directories you have accessed, so that you can quickly reference them in the command line.

The name fasd comes from the default suggested aliases f(files), a(files/directories), s(show/search/select), d(directories).

Fasd ranks files and directories by “frecency,” that is, by both “frequency” and “recency.” The term “frecency” was first coined by Mozilla and used in Firefox (link).

Introduction

If you use your shell to navigate and launch applications, fasd can help you do it more efficiently. With fasd, you can open files regardless of which directory you are in. Just with a few key strings, fasd can find a “frecent” file or directory and open it with command you specify. Below are some hypothetical situations, where you can type in the command on the left and fasd will “expand” your command into the right side. Pretty magic, huh?

 v def conf       =>     vim /some/awkward/path/to/type/default.conf
  j abc            =>     cd /hell/of/a/awkward/path/to/get/to/abcdef
  m movie          =>     mplayer /whatever/whatever/whatever/awesome_movie.mp4
  o eng paper      =>     xdg-open /you/dont/remember/where/english_paper.pdf
  vim `f rc lo`    =>     vim /etc/rc.local
  vim `f rc conf`  =>     vim /etc/rc.conf

Fasd comes with some useful aliases by default:

alias a='fasd -a'        # any
alias s='fasd -si'       # show / search / select
alias d='fasd -d'        # directory
alias f='fasd -f'        # file
alias sd='fasd -sid'     # interactive directory selection
alias sf='fasd -sif'     # interactive file selection
alias z='fasd_cd -d'     # cd, same functionality as j in autojump
alias zz='fasd_cd -d -i' # cd with interactive selection

Fasd will smartly detect when to display a list of files or just the best match. For instance, when you call fasd in a subshell with some search parameters, fasd will only return the best match. This enables you to do:

mv update.html `d www`
cp `f mov` .

Subscribe to the Newsletter

Get our latest news,tutorials,guides,tips & deals delivered to your inbox.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.