Search Terminal Output

15

5

Using a default terminal and bash, there is no functionality to search the standard output of commands.

One can gain such functionality using other tools, like emacs shell or screen, but I am wondering why such a useful feature is missing, I do remember a simple C-F used to work in terminals.

Is there a way to make the Gnome terminal app support output search? or is there a better terminal app that support searching output natively?

Samer Buna

Posted 2010-10-02T23:45:40.210

Reputation: 455

Does piping the command into less not give you what you desire? You can search text in less and many other pagers. Also, shouldn't this be on super user? – None – 2010-10-02T23:54:34.123

Yes, less is good for one command output, but I often do multiple commands and come back later with the need to search all output – None – 2010-10-02T23:58:39.247

Answers

3

You could try script(1). On login just call script and you can then search through the typescript file it generates. It's not a single keystroke like emacs shell and it is buffered, but it might be better than nothing.

Paul Rubel

Posted 2010-10-02T23:45:40.210

Reputation: 291

Can you search script while script is running? I tried and couldn't... – user1527227 – 2014-04-25T19:45:39.710

23

Try Ctr + Shift + f. This works on Ubuntu terminal and Terminator

Udara S.S Liyanage

Posted 2010-10-02T23:45:40.210

Reputation: 491

Same hotkey in gnome-terminal. – Mikhail Moskalev – 2016-04-09T12:24:23.770

1

Using xterm, you can log everything the terminal displays to a file. Then you can open that file in an editor or less.

garyjohn

Posted 2010-10-02T23:45:40.210

Reputation: 29 085

1

In screen you can enter copy mode and do searches on output. You can also do logging of output to a file and search it any way you normally would (grep, less, etc.).

Paused until further notice.

Posted 2010-10-02T23:45:40.210

Reputation: 86 075

0

Don't know gnome-terminal but urxvt does that by typing Alt + s. It should be in your repositories, lookup the package rxvt-unicode.

cYrus

Posted 2010-10-02T23:45:40.210

Reputation: 18 102