WriteBash - In the Linux system, there are very long text files, such as system log files. To be able to view long text files easily, you can use the
What is the less command?
The less command is a program designed to replace a previously existing command on Unix that is
more. The word
less comes from the phrase “less is more“, which is the motto of modern architects.
more command, the
less command lets you view the content of a text file as pages, which is crucial when you want to see the content of a very long text file. Other than the
more command can only view the page forward, the
less command can view the page backward.
Use the less command to view long text
Less command is very simple to use, you just need to type the command and followed by the file name (or absolute path to the file).
The table below lists the most common keyboard commands used by less:
|Page Up or b||Scroll back one page|
|Page Down or space||Scroll forward one page|
|Up Arrow||Scroll up one line|
|Down Arrow||Scroll down one line|
|G||Move to the end of the text file|
|1G or g||Move to the beginning of the text file|
|/characters||Search forward to the next occurrence of characters|
|n||Search for the next occurrence of the previous search|
|h||Display help screen|
For long text files on linux, you will often have to use the
less command and hopefully through this article, those who are new to Linux will use it more easily.
If you appreciate what we share in this blog, you can support us by:
- Stay connected to: Facebook | Twitter | Google Plus | YouTube
- Subscribe email to recieve new posts from us: Sign up now.
- Start your own blog with SSD VPS - Free Let's Encrypt SSL ($2.5/month).
- Become a Supporter - Make a contribution via PayPal.
- Support us by purchasing Ribbon Lite Child theme being using on this website.
We are thankful for your support.