-
-
Notifications
You must be signed in to change notification settings - Fork 1
Linux less Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to less on Linux, covering Arch Linux, CachyOS, and other distributions including file viewing, text navigation, and pager usage.
less is file pager (viewer).
Features:
- View files: Display file contents
- Scroll: Navigate through files
- Search: Find text in file
- Large files: Handle large files efficiently
Why it matters:
- File viewing: View any file
- Log viewing: Read log files
- Text files: View text files
-
Better than more: More features than
more
Open file:
# View file
less file.txt
# Or pipe to less
command | lessQuit:
- q: Quit less
- Q: Force quit
Navigate:
- Space: Next page
- b: Previous page
- Enter: Next line
- Arrow keys: Move line by line
- Page Up/Down: Page navigation
Quick navigation:
- g: Go to beginning
- G: Go to end
- 50g: Go to line 50
- /pattern: Search forward
- ?pattern: Search backward
Find text:
# In less
/pattern
# Search forward
?pattern
# Search backward
n: Next match
N: Previous matchShow numbers:
# In less
-N
# Or start with
less -N file.txtCheck installation:
# Check less
which less
less --version
# Install if missing
sudo pacman -S lessThis guide covered less usage, file viewing, and navigation for Arch Linux, CachyOS, and other distributions.
- head and tail Guide - File viewing
- cat Guide - File display
-
less Documentation:
man less
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.