Skip to main content
⚑ OpenDevDocs
Linux
linuxlinux-commandsReferenceBeginner

Interactive File Pager (less)

View and search large text files interactively without loading the entire file into memory using less.

Verified: 2026-09-30
Tested on:linux Ubuntu 24.04 / Debian 12
Platforms:
linuxmacos
#linux#less#pager#logs#cli

Command

less /var/log/syslog


Short Description

less is a terminal pager program used to view the contents of a text file one page at a time. Unlike cat, less does not read the entire file before starting, making it fast on multi-gigabyte log files.


Essential Keybindings in less

KeyAction
j / Down ArrowScroll down one line
k / Up ArrowScroll up one line
Space / Page DownScroll down one full page
b / Page UpScroll up one full page
/patternSearch forward for pattern (n for next match, N for previous)
?patternSearch backward for pattern
GJump to the very end of the file
gJump to the very top of the file
FFollow live log stream in real time (like tail -f, press Ctrl+C to pause)
qQuit less

Examples

# View large nginx access log with line numbers (-N) and preserved color codes (-R)
less -NR /var/log/nginx/access.log

On this page