2fm.dev - TwoFullMoons

less is more

If you work with text files in Linux, you've likely encountered situations where you need to examine file contents without modifying them. The less command is one of the most versatile tools for this purpose, offering significantly more features than its predecessor, more.

What is 'less'?

Despite its name suggesting otherwise, less is actually more powerful than the more command. The name comes from the Unix philosophy phrase "less is more." It's a pager program that allows you to view text files one screen at a time, with robust navigation capabilities.

Key Features

Basic Usage

less filename.txt

While viewing a file with less, you can use these keyboard shortcuts:

Why Choose 'less'?

The less command doesn't load the entire file into memory, making it perfect for viewing large log files or documentation. It's also part of most Linux distributions by default, so you can count on it being available wherever you're working.

Next time you need to examine a file's contents in Linux, remember: with less, you can do more!