How to install less on CentOS / RHEL / Fedora

Less is a command-line tool that allows you to view text files in a paginated manner. You can install it on CentOS, RHEL, and Fedora using the package manager. (https://www.fi-di.com/)

To install less on CentOS or RHEL:

  1. Run the command “sudo yum install less” to install the less package.

To install less on Fedora:

  1. Run the command “sudo dnf install less” to install the less package.

Both commands will install the less package and its dependencies. Once the installation is complete, you can use the “less” command to view text files in a paginated manner.

You can also use the “less” command to view the output of other commands, like “cat” or “grep”, by pipelining them. For example, you can use the command “cat /path/to/file | less” to view the contents of a file in a paginated manner.

Please note that on some systems, less is already installed, in that case the command will return a message indicating that the package is already installed.

It’s also important to note that there are other tools like “more” that can be used for the same purpose, but less has more functionality and is more widely used.

Leave a Comment