Is there a way to configure bash to always page output?
772
I'd like to configure bash to page the output of all commands. Essentially, I want bash to behave as if every command I enter ended with '| less'. Is this possible?
Then when you want to do ls -l|less you'd type ls -l and press control-J instead of <enter>.
I would not recommend swapping the j and m in the bind command (or in the .inputrc file). Every time you'd press <enter> you'd get |less added which could be pretty annoying.
You could do this:
Or put this in your
~/.inputrc
:Then when you want to do
ls -l|less
you'd typels -l
and presscontrol-J
instead of<enter>
.I would not recommend swapping the j and m in the bind command (or in the .inputrc file). Every time you'd press
<enter>
you'd get|less
added which could be pretty annoying.I'm not sure if this is possible, but you can definitely make it easier on yourself by doing something like this in your .bashrc:
ll |p
then becomes a paged listing.EDIT: As a note though this still wont work for something that is going to STDERR. You would need to something like:
errorcommand 2>&1 |p