I'm noticing that when I run certain commands on my system, their output is displayed in a read-only mode with an (END) at the bottom. This requires me to press a key to exit, which is a bit annoying. Can someone explain why this happens and if there's a way to turn this feature off permanently?
2 Answers
I think it's great that commands halt for viewing when the output is long. It really helps you not miss crucial details, especially for commands that produce a lot of information. But I see your point—the inconsistency can be frustrating sometimes, especially if you're trying to automate tasks.
When command output ends with (END), it's being sent to a program called 'less'. This gives you the ability to scroll through long output in a terminal that doesn't support scrolling itself. If you'd rather not use 'less', you can set your environment variable to use 'cat' instead, which simply prints everything without pausing.
You can do this by setting 'PAGER' to 'cat' in your terminal. Just add this line to your ~/.bashrc: 'export PAGER=cat', then source the file with '. ~/.bashrc'. This will stop the output from being piped to 'less'.
Yeah, the inconsistency of which commands do this is confusing. If scripting is your goal, it's better to uniform all outputs to avoid unexpected pauses.