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’.
- HOW TO INSTALL KDENLIVE VIDEO EDITOR IN LINUX [VIDEO] - September 14, 2020
- Mozilla Launches a Virtual Private Network (VPN) Service - July 31, 2020
- The Second Cohort of #BUILDFORSDG Challenge 2020 is out! - July 24, 2020