If you’re talking about the login shell - one way to access scroll-back functionality is to use a terminal multiplexer like screen, or tmux.
In tmux you press your leader key (which by default in tmux is C-b i.e. control and b. But it can be remapped - I remapped my leader key to C-a) then press { which puts tmux into copy mode.
From there, if your shell is set to use emacs style keybinds (default in most shells) you can use the up/down arrows to move the cursor up or down through the scroll-back buffer. Left and right arrows move the caret a character to the left, or right. Or use emacs style keybinds like C-v and alt-v to go down/up a whole page. Other emacs-style motion keybinds work too!
If, you have your shell set to use vi style keybinds, you can use j to move up a line, k to move down, h and l move the caret left and right. C-b to scroll back a page, or C-f to scroll forward a page. And again - other common vi/vim motion keybinds will work.
Tmux’s Copy mode can also be used to highlight/select text to copy/paste- which allows you to copy text to an internal buffer and paste it into any other terminals you have open in tmux. There is also an add-on for tmux called tmux-yank, which can copy text to the global clipboard - which will allow you to paste text in applications running outside of your tmux session ( E.g. in a desktop/window manager, this is handy for copy/pasting Error messages from a tmux session in the terminal into your browser, to search for a solution to a problem, or into any other GUI based applications you might need to paste text into!).
But I won’t go into detail on selecting/copying/pasting text here. The main thing you’re interested in is using the scroll-back.
To exit tmux’s copy mode, hit escape or use C-c and you’ll be returned to normal mode and will be at the end of the buffer, ready to enter another command.
I haven’t used screen in a long time, but it has a similar copy mode, which functions similarly and gives you a scroll-back mechanism.
There’s a post describing its functionality here:
I use screen for my command-line tasks while managing the servers where I work. I usually run small commands (mostly file-system tasks) but sometimes I run more extensive tasks (like DBA). The out...
unix.stackexchange.com