Suppose I have a Terminal open that contains thousands of lines of output from my previous commands over the past few hours/days. How do I search that recorded output for a string? I'm especially interested in a solution that doesn't require the mouse.
I know I should have used tee, but that's not always convenient.
I know I could "Select All", then open an editor, paste, then search, but I'm hoping for something simpler (and Select All seems to require the mouse).
I was hoping there would be a "Find..." command in the menu bar (like Mac OS X has).
16 Answers
Finding text in scrollback is a weakness of most terminal emulators; the only ones I know of that provide it are OS X Terminal and Terminator. That said, you could run GNU screen in any terminal and search its scrollback buffer in copy mode.
4If you are running a gnome-terminal (default GUI terminal on ubuntu) you can hit shift+ctrl+f, type your search terms, and hit enter. Still graphical, but no mouse required.
Shortcut to find string inside the terminal data : ctrl + shift + f
1Have you considered using pipe and grep?
YourCommand | grep strHope this helps
2Try konsole in kde. It works with gnome/unity too. Program the Find shortcut to alt-f or ctrl-f, it can search forward or backward, plus it will highlight new output that matched the searching pattern.
For the logs: also guake supports searching via ctrl+shift+f since was merged