How to scroll up in terminal on Linux

The command line is the most powerful feature of a Linux system, as it allows users to quickly accomplish tasks that would usually take longer using a GUI. In order to be more efficient with using the command line terminal, it is important to know how to navigate around it more quickly. In this tutorial, we will show you how to scroll up in the terminal on a Linux system. This will work for systems that are not using a GUI, such as when logged into an SSH session.

In this tutorial you will learn:

  • How to scroll up in a Linux command line terminal using keyboard shortcuts
  • How to scroll one line at a time
  • How to scroll one full page at a time
  • How to return to cursor position
How to scroll up in terminal on Linux
How to scroll up in terminal on Linux
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Any Linux distro
Software N/A
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

How to scroll up in terminal on Linux




Here are the various ways to scroll up in your Linux terminal and navigate around as needed.

DID YOU KNOW?
These keyboard shortcuts will work whether you are using a GUI terminal or strictly command line interface (for example, if no desktop environment is installed at all). Of course, with a GUI, you have additional options like the scroll wheel on your mouse. Otherwise, we are stuck with using keyboard shorcuts, which you will likely find very efficient anyway.
  1. To scroll up one line at a time in your terminal, use the Ctrl + Shift + Up keyboard combination. In other words, hold down Ctrl and Shift simultaneously, and then tap the Up arrow key to move up one line at a time in your terminal.
  2. In case you find scrolling by one line at a time to be too slow, we can scroll one whole page at a time by using the Shift + PgUp keyboard combination.
  3. If you are using the more or less Linux commands to view the contents of a file, you can scroll back up by using the b button on your keyboard.
  4. If, after scrolling up a ways, you need to return to your original cursor position, you can use the Ctrl + End keyboard combination to accomplish that.
  5. Also handy to know is that Ctrl + Shift + Down will scroll down one line at a time, and Shift + PgDn will scroll down one whole page at a time in terminal.
NOTE
On smaller keyboards (for example, laptop keyboards), you may need to also hold down the Fn (function key) to access some of the keys mentioned in this tutorial. On my keyboard, the PgUp key is in the same spot as the Up arrow key, so this keyboard requires me to hold down the Fn key to access the PgUp key.

Closing Thoughts




In this tutorial, we saw how to scroll up in the terminal on a Linux system. For users that frequently use the command line, it is absolutely essential to know how to scroll around the console quickly and efficiently. Even reaching for the mouse can be a waste of time when you are in the zone and cranking out commands in your terminal. Knowing these keyboard shortcuts will help you navigate around the command line terminal very efficiently.



Comments and Discussions
Linux Forum