Using the command line is a time-honoured tradition in Linux (at least for those that like to get their hands dirty with commands). One of the common acts carried out when using the CLI is that of displaying and manipulating texts, and Linux is so much rich with commands to achieve this. The cat command is a very good example.
The cat command is used to display the content of a file on screen. However, if the file being displayed is large, then the entire content will scroll up the screen. To view the file one screen-full at a time, you can use the more or less commands;
THE more COMMAND
The more command is to display data one screen-full at time while viewing a file using the more command, once you have scrolled down you cannot move up
The above command will display a page—wise (text divided based on the size of the screen viewed one screen-full at a time) listing of the contents of the file.
THE less COMMAND
The less command is similar to the more command except that you can scroll upwards also while viewing the contents of a file. The less command is also a little faster than the more command.
env | more or env | less
dmesg | more or env | less
tree | more or tree | less
After using the less or more; to move up and down the screen, you can use the arrow keys. You can also specify a number to move down the screen by that number of lines. To quit the display, you have to type ‘q’.
Latest posts by ALEXANDER WAYNE OMOROKUNWA (see all)
- How To Install And Setup Git In Linux - August 1, 2019
- How to Install Geany IDE on Linux - July 16, 2019
- Why Microsoft Creates it Own Linux-based Operating System for IoT. - June 26, 2019