I am wondering about some bash environment setting here: is it possible to set stdout of bash as a pipe to /bin/more? You know, like using vi as editor for your commands it should be possible to avoid using Ctrl-PgUp or Ctrl-PgDown for looking on all the output (by default).
To be more specific: I don't want to pipe the output of a single command to more like:
$> ls | more a b c ... --more--
BUT: pipe any output of my current session to more, so to get either all output printet as usual just beneath the prompt - or if it's too much, screen-wise.
# automatically piped to more: $> ls a b c ... --more--
Is there any bash-built-in to accomplish this?
EDIT: I wasn't specific enough, sorry for that: I am aware of "script" and command grouping like
(cmdA; cmdB) | less
What I really would like is to automatically avoid getting a 100 page output at once but instead have a more-like behavior of bash'es stdout. As could be accomplished by adding
2>&1 | more
to all commands entered on command promt - just automatically.
Your question is not specific enough as to what you are trying to achieve. I'll take a few guesses:
If you would like to keep track of anything that happens in a session, use
man script for more information.
If you would like to combine the output of multiple commands into one block piped into
less use braces like so:
(date; echo; cat /etc/hosts; echo; cat /etc/resolv.conf; echo; host bla.bla) | less
Using more concurrently while typing into the shell won't work as both the shell as well as
less will want to read the keyboard from
stdin. That's why we have page up and down and search facilities in terminal programs nowadays.