I have a program that outputs some data to the terminal (via printf() ). Is it possible search a text on the outputed text on the terminal directly? It is possible to do search by directing the texts into a file then make search on it then output the result to the terminal, but it is not what I am asking.EDIT: what I meant by search: I wonder if it is possible to search a text, for example how can I search libgnome-desktop on the below terminal output?
how to make search a text on the terminal directly
terminal;search
You could use the terminal multiplexer tmux to run your program in any terminal. Then you can search through the window entering copy mode with Ctrl-b [, and use emacs (Ctrl-s) or vi (/) keywords to search for a string depending on whether emacs or vi mode is selected.The keys available to exit copy mode are Esc or Enter for different versions of tmux.Alternatively, some terminals support searching the window buffer, like urxvt with the searchable-scrollback Perl extension.