What is fzf?
fzf is a general-purpose command-line fuzzy finder. It’s an interactive Unix filter for command-line that can be used with any list; files, command history, processes, hostnames, bookmarks, git commits, etc.
Install fzf in any OS using git:
1 2 3 |
## Using git git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf ~/.fzf/install |
Install fzf on MAC OS:
1 2 3 4 5 |
## Using homebrew brew install fzf ## To install useful key bindings and fuzzy completion: $(brew --prefix)/opt/fzf/install |
Install fzf on Windows OS:
1 2 |
## Using choco choco install fzf |
Install fzf on Alpine Linux OS:
1 2 |
## install fzf sudo apk add fzf |
Install fzf on Debian 9+/Ubuntu 19.10+ OS:
1 2 |
## install fzf sudo apt-get install fzf |
Install fzf on Fedora OS:
1 2 |
## install fzf sudo dnf install fzf |
Install fzf on NixOS OS:
1 2 |
## install fzf nix-env -iA nixpkgs.fzf |
Install fzf on Arch Linux OS:
1 2 |
## install fzf sudo pacman -S fzf |
Install fzf on FreeBSD OS:
1 2 |
## install fzf pkg install fzf |
Install fzf on NetBSD OS:
1 2 |
## install fzf pkgin install fzf |
Install fzf on OpenBSD OS:
1 2 |
## install fzf pkg_add fzf |
Install fzf on openSUSE OS:
1 2 |
## install fzf sudo zypper install fzf |
Finder Navigation:
- CTRL-K / CTRL-J (or CTRL-P / CTRL-N) to move cursor up and down
- Enter key to select the item, CTRL-C / CTRL-G / ESC to exit
- On multi-select mode (-m), TAB and Shift-TAB to mark multiple items
- Emacs style key bindings
- Mouse: scroll, click, double-click; shift-click and shift-scroll on multi-select mode
Example Usage:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
## -------------------------------- ## With output from another command ## -------------------------------- ## Find files in current directory find * -type f | fzf > selected ## select git branches in horizontal split below (15 lines) git branch | fzf-tmux -d 15 ## select multiple words in vertical split on the left (20% of screen width) cat /usr/share/dict/words | fzf-tmux -l 20% --multi --reverse ## --------------- ## Auto-complition ## --------------- ## Files under the current directory vim ** ## Files under parent directory vim ../** ## Files under parent directory that match `fzf` vim ../fzf** ## Files under your home directory vim ~/** ## Directories under current directory (single-selection) cd ** ## Directories under ~/github that match `fzf` cd ~/github/fzf** ## Can select multiple processes with kill -9 ## SSH or telnet ssh ** telnet ** ## Set, unset env variables unset ** export ** unalias ** |
Please refer https://github.com/junegunn/fzf for more details.