The input is the area at the bottom of the focused panel, in which you can type a filter or a command.
Its parts are
- a filtering pattern
- a verb invocation, starting with a space or a colon (
Both parts are optional.
The filtering pattern
A search pattern is made of 1 to 3 parts separated by the
/ character but you rarely need the two
The syntax is globally
The mode is either nothing (fuzzy path), just a slash (regex name) or some letters followed by a slash.
The search mode combines
- the search type: fuzzy, regex, exact, tokens
- the search object: file name, file path, file content
|mode||example query||example match||explanation|
||search for "abc" in a fuzzy way in sub-paths from current tree root|
||search for "abc" in a fuzzy way in filenames|
||search for the "ab" and "cd" tokens, in whatever order (case and diacritics insensitive)|
||search for the string "Bac" in filenames|
||search for the regular expression
||find files whose name ends in
||search for the regular expression
||search for "te/d" in sub-paths from current tree root|
||search for the
||search for the "ab" and "cd" tokens in sub-paths from current tree root|
||search for the "mask" string in file contents|
||search with a regular expression in file contents -
||search a word with a regular expression in file contents|
It's also possible to redefine those mode mappings.
To escape characters (for example the space, colon or slash) in the pattern, use a
\ (an antislash is
Combining filtering patterns
Patterns can be combined with the
& (and) and
| (or) operators, and parentheses if necessary.
You can for example display non
json files containing either
The characters you use as operators and the parenthesis can be useful in patterns too, either because you want to search for them in fuzzy patterns or in file contents, or because you write non trivial regular expressions.
Most often you'll just type what feels natural and broot will select the interpretation which makes sense but you might be interested in a few rules:
- parenthesis and operators in the second pattern part (parts being separated by
/) are part of the pattern, which explains why
/(json|xml)is interpreted as a regular expression. If you want to do a fuzzy search for a
|in the name of your files, you'll need to either escape it as
\|or to have an explicit pattern mode :
a|bwould search for files whose name contains either
b. And to ensure an operator or closing parenthesis isn't interpreted as part of your pattern, close it with a
- broot interprets the left operand before the right one and doesn't interpret the second one if it's not necessary. So if you want to search your whole disk for json files containing
abcd, it will be faster to use
c/abcd/&/json$/which would look at the file name only after having scanned the content.
The verb invocation
The verb invocation is
where arguments can be empty, depending on the verb's behaviour and invocation pattern.
Verbs are detailed in the Verbs & Commands chapter.
A Fuzzy Path search:
A regular expression based search:
A search followed by a command without arguments:
re rm (which is equivalent to
This is very natural: You use the search to select your element and you don't need to remove it before typing the command.
A search followed by a command taking an argument:
re mv ../regex.rs
A full text search
In this case with an escaped space:
A regular expression based full text search
A complex composite search
Here we search for
"carg" both in file names and file contents, and we exclude
/ at the end of
c/carg/ is necessary to tell broot that the following parenthesis isn't part of the pattern.