Search Syntax
WARNING: This document is for an older version of iTerm2.
When iTerm2 presents a list of profiles, it usually includes a search box. The search box uses a special syntax that letes you tailor your searches to quickly find what you're looking for.
Searching Profiles
Each word in the search query must match at least one word in either the title or the tags of a profile in order for that profile to be matched by the query. For a word to be a match, it must be a substring.
Query |   | Profile Name | Matches? | |
---|---|---|---|---|
Linux | Linux | Yes | ||
x | Linux | Yes | ||
z | Linux | No | ||
George L | George's Linux Machine | Yes |
Operators
You may prefix a phrase in the search query with an operator to narrow your query. These operators are defined:
- The name: operator only tries to match words in the profile's name.
- The tag: operator only tries to match words in the profile's tags.
- The command: operator only tries to match words in the proifle's command. Note that the command is only searched for words that explicitly use the
command
operator. Available in iTerm2 version 3.5.5 and later.
Quoting
You can require that two or more words occur in order by putting quotes in your query. For example:
Query | Profile Name | Matches? | |
---|---|---|---|
"Linux machine" | George's Linux machine | Yes | |
"machine Linux" | Linux machine | No |
Anchoring
Normally, words in a query must match a substring of a word in the title or tags of a profile. You can require that a word in your query matches a prefix of a word in the title or tags by inserting a caret (^) before the word. You can require that a word in your query matches the suffix of a word in the title or tags by appending a dollar sign ($) after the word. For example, the query ^a matches only profiles with words starting with "a". The query a$ matches words ending in "a". The query ^a$ matches only the word "a".
Query |   | Profile Name | Matches? |
---|---|---|---|
^root | [email protected] | Yes | |
^root | Groot! | No | |
root$ | Groot | Yes | |
^root$ | Groot | No | |
^root$ | root | Yes |
Combining Features
You may combine quoting, operators, and anchors. The operator always comes first, followed by a caret, followed by a quoted string, followed by a dollar sign. Consider the following examples:
name:^"George's Linux Machine"$
Three consecutive whole words in the profile's name must equal "George's Linux Machine".
name:"George's Linux Machine"$
Would match a profile named "XGeorge's Linux Machine", unlike the previous example.
name:^"George's Linux Machine"
Would match a profile named "George's Linux MachineX", unlike the first example.
name:"George's Linux Machine"
Would match a profile named "XGeorge's Linux MachineX", unlike the first example.
name:^George's name:George's$ name:^George's$
A word having the prefix, suffix, or exactly matching "George's" must occur in the profile's name to match these queries, respectively.