Fuzzy file search in Linux console

Issue

Does anybody know a way to perform a quick fuzzy search on the Linux console?

Quite often I come across situations where I need to find a file in a project but I don’t remember the exact filename.

In the Sublime text editor I would press Ctrl+ P and type a part of the name, which will produce a list of files to select from. That’s an amazing feature I’m quite happy with. The problem is that in most cases I have to browse code in a console on remote machines via ssh. I’m wondering if there is a tool similar to the "Go Anywhere" feature for the Linux console?

Solution

You may find fzf useful. It’s a general purpose fuzzy finder written in Go that can be used with any list of things: files, processes, command history, Git branches, etc.

Its install script will setup a Ctrl+T keybinding for your shell. Pressing Ctrl+T lets you fuzzy-search for a file or directory and put its path on your console.

The following GIF shows example usage of fzf including its Vim integration:

Animation of using FZF

Answered By – Junegunn Choi

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published