21
9
I make extensive use of the functions to navigate through the command history in my terminal; I wonder if there is some way to navigate the command output history as well? (besides keeping a large histsize and leaning on the pgup key)
I cannot just 'rerun the command', as in my particular situation the source of the commands changes; I frequently need to look back at the output of a previous change.
Hacks welcome.
Thanks!
Edit 2010:
I've given 'tee' the credit; among all the methods to log your session elsewhere, it's the most broadly applicable (i.e. it's part of gnu coreutils, and doesnt require a specific shell or utility to work). It wasn't really what I was looking for, but I realize that such a thing doesn't really exist.
The closest approximation I can think of is to use something like screen
(byobu/tmux) that logs to file, and write (and keybind) a custom command to page/search through that logfile (think less
paging by prompt rather than screen). Thanks everyone.
Edit 2012:
@Dustin Kirkland's answer is clearly best, at least generally; the terminal's scrollback buffer is least-intrusive way to navigate command output history. Byobu appears to have a large default number of history lines saved (10K; tmux has 2K, GNU screen 100), and it allows regex searches (a cursory look indicates that GNU screen has no scrollback search, and tmux has only plaintext search).
Where is scrollback history stored, and is there a way to make it persist between sessions? I.e.: Open terminal with Byobu, run some commands, call
exit
, close terminal, open a new terminal with Byobu and still have the previous session. – Darrel Holt – 2019-07-31T16:53:25.927