Forrest logo
back to the fzf tool

fzf:tldr:ff4b8

fzf: Start fzf on entries that start with core and end with either go, rb, or py.
$ fzf --query "^core go$ | rb$ | py$"
try on your machine

The command "fzf --query "^core go$ | rb$ | py$"" is used with the fzf command-line fuzzy finder tool.

Fzf is a tool that allows you to search and select items from a list using fuzzy matching. It can be used as a command-line interactive filter or as a standalone fuzzy finder for text input.

In this specific command, the '--query' option is used to specify the initial query that will be used to prepopulate the fzf search input. The caret (^) symbol at the beginning means that the query should match at the start of the line.

The query itself is a regular expression pattern that matches three different options:

  1. "^core go$": This matches the string "core go" exactly, where "^" indicates the beginning of the line and "$" indicates the end of the line. So, if there is a line that contains only "core go", it will be preselected in the fzf search input.

  2. "rb$": This matches any string that ends with "rb". The "$" symbol ensures that the matching pattern should occur at the end of the line.

  3. "py$": This matches any string that ends with "py". Similar to the previous option, the "$" symbol ensures that the matching pattern should occur at the end of the line.

Therefore, when you run the command, the fzf search input will be prepopulated with either "core go" or any line that ends with "rb" or "py". You can modify the query or select other options in the fzf interface to narrow down your search.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the fzf tool