
Tired of less
? Discover 4 Modern CLI Pagers for a Better Terminal Experience
For developers, system administrators, and command-line power users, the less
command is a daily workhorse. It’s the default pager in countless environments, allowing us to view log files, read man pages, and inspect command output without flooding our terminal. While indispensable, less
is a tool from a different era—one before widespread syntax highlighting and rich formatting became standard.
If you find yourself wishing for more from your command-line file viewer, you’re in luck. A new generation of CLI tools has emerged to provide a vastly improved experience. These modern alternatives, often called pagers, offer features like syntax highlighting, Git integration, and better handling of structured data.
Here are four powerful alternatives to less
that can dramatically upgrade your terminal workflow.
1. bat
: The Feature-Packed Viewer
Perhaps the most popular modern alternative is bat
, which bills itself as “a cat clone with wings.” While it can be used to quickly display file contents like cat
, its real power is unleashed when viewing larger files that require a pager. bat
automatically pipes its output through less
, enhancing it with a suite of modern features.
Key Features:
- Automatic Syntax Highlighting:
bat
supports a huge number of programming and markup languages out of the box, making code review in the terminal a pleasure. - Git Integration: It integrates directly with Git to show modifications in the sidebar. You can instantly see which lines have been added, modified, or deleted.
- Line Numbers and Headers: Displays clear line numbers and a file header, providing crucial context that
less
lacks. - Non-Printable Character Display: Shows tabs, spaces, and newlines clearly, which is invaluable for debugging formatting issues.
How to get started: On most systems, you can install it with a package manager. For example, on Ubuntu/Debian, use sudo apt-get install bat
, or on macOS with Homebrew, brew install bat
.
2. delta
: The Ultimate Git Diff Companion
While bat
is an excellent all-purpose viewer, delta
is a specialized tool designed to make your git diff
output beautiful and easy to understand. It acts as a pager for Git, transforming the standard diff view into a clean, modern, side-by-side comparison.
If you spend a significant amount of time reviewing code changes with git diff
, git show
, or git log
, delta
is a game-changer.
Key Features:
- Side-by-Side Diff Views: Presents code changes in a clear, two-column layout, making it much easier to track changes compared to the traditional unified diff format.
- Syntax Highlighting in Diffs: Highlights the code within the diff itself, preserving the context and improving readability.
- Line Numbering and Change Tracking: Provides precise line numbers and highlights within lines to pinpoint exact character changes.
- Highly Customizable: You can configure colors, layouts, and themes to match your personal preferences and terminal setup.
How to get started: After installing delta
(e.g., brew install git-delta
), you need to configure Git to use it. Add the following lines to your .gitconfig
file:
[core]
pager = delta
[interactive]
diffFilter = delta --color-only
3. most
: The Underappreciated Powerhouse
The most
pager has been around for a long time but remains a powerful and lightweight alternative to less
. It addresses one of the most common frustrations with less
: handling long lines that wrap poorly and disrupt formatting.
most
is the ideal choice if you want a minimal, fast pager that simply does its job without any fuss. It’s especially useful for viewing wide log files or data files with long, unbroken lines.
Key Features:
- Horizontal Scrolling: This is
most
‘s killer feature. It doesn’t wrap long lines by default. Instead, it lets you scroll left and right, preserving the original layout of the file. - Status Bar: Provides a helpful status bar at the bottom that shows the filename, line number, and percentage through the file.
- Multiple Windows:
most
allows you to split your terminal screen to view two different parts of a file or even two different files at once. - Binary File Viewing: It can safely display binary files without scrambling your terminal.
How to get started: Install it with your system’s package manager, such as sudo apt-get install most
or brew install most
.
4. rich-cli
: For Beautifully Rendered Markup
The rich-cli
tool is designed for one thing: displaying beautifully formatted content in the terminal. Built with the powerful Python rich
library, it excels at rendering structured data and markup languages.
While bat
handles syntax highlighting for code, rich-cli
is the superior choice for viewing Markdown, JSON, and other formatted files.
Key Features:
- Markdown Rendering: Displays Markdown files with proper headings, bold/italic text, code blocks, tables, and lists. This is perfect for reading project
README.md
files directly in the terminal. - Pretty-Printed JSON/YAML: Automatically formats and colorizes JSON and YAML files, making them far easier to navigate and understand.
- Syntax Highlighting: Like
bat
, it also provides syntax highlighting for a wide variety of source code files. - Table Rendering: Can render tabular data from CSV files into perfectly aligned tables.
How to get started: rich-cli
is a Python package, so the easiest way to install it is with pip
: pip install rich-cli
.
Which Pager Should You Choose? A Quick Comparison
| Feature | less
| most
| bat
| delta
| rich-cli
|
| ———————– | —— | ———- | ———— | ———— | ———— |
| Syntax Highlighting | No | No | Excellent| Excellent| Excellent|
| Git Integration | No | No | Excellent| Superior | No |
| Horizontal Scrolling| No | Yes | No | No | No |
| Side-by-Side Diffs | No | No | No | Yes | No |
| Markdown Rendering | No | No | Basic | Basic | Superior |
Final Thoughts
The default less
command is reliable, but the terminal has evolved. By embracing modern tools, you can make your command-line experience more efficient, productive, and visually appealing.
For a great all-around upgrade, start with bat
. If your daily workflow is centered on Git, adding delta
is a must. For those who frequently work with log files or wide data, most
is a simple but effective improvement. And if you want to properly read formatted documents like Markdown, rich-cli
is the tool for the job.
Don’t settle for the defaults. Take a few minutes to install one of these alternatives and see how a modern pager can transform your workflow.
Source: https://www.linuxlinks.com/alternatives-popular-cli-tools-less/