To search in tmux, first enter copy mode with Ctrl+b [
, then press /
to search forward or ?
to search backward. Type your search pattern and press Enter. Use n
and N
to navigate through matches.
Searching in tmux allows you to locate specific text within your terminal buffer, including scrollback history. This is useful for finding commands, error messages, or any specific output without having to manually scroll.
Ctrl+b [
to enter copy mode/
to search forward or ?
to search backwardEnter
to start the searchn
to find the next occurrenceN
to find the previous occurrenceq
to exit copy modeset-window-option -g mode-keys vi
in ~/.tmux.conf
.By default, tmux search is case-sensitive and uses basic pattern matching. In vi mode, some regular expression features are supported:
^
- Match start of line$
- Match end of line.
- Match any character*
- Match 0 or more of previous character