Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

Use fzf

fzf is a funky command line fuzzy searcher.

Use your normal reverse history search and see fzf work it’s magic.


If you want to use it under WSL with Ubuntu. I recommend installing from Git:

$ git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
$ ~/.fzf/install

If you follow the standard documentation, you will observe several errors:

.fzf/install: line 2: $'\r': command not found
: invalid optionne 3: set: -
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
.fzf/install: line 4: $'\r': command not found
.fzf/install: line 14: $'\r': command not found
.fzf/install: line 15: syntax error near unexpected token `$'{\r''
'fzf/install: line 15: `help() {

This all boils down to Bash using CRLF on Ubuntu on WSL, so you have to convert the script, using a tool like dos2unix

$ dos2unix ~/.fzf/install

The installation runs and you have to follow up with the following conversions:

$ dos2unix ~/.fzf/shell/key-bindings.bash

And you are go to go…