less command (Linux / bash / sh / zsh)
What it does
Page through text interactively without loading it all at once. When people search for the less command linux, they usually want less's everyday flags, safe examples, and how it differs from related tools. Below you'll find syntax, options, and copyable examples for Bash/sh/zsh.
Page through text interactively without loading it all at once.
Syntax
less [OPTION]... [FILE]...
Common options
| Flag / option | Meaning |
|---|---|
| -N | Show line numbers. |
| -S | Chop long lines instead of wrapping. |
| -i | Ignore case in searches unless uppercase is used. |
| +F | Follow a growing file like tail -f. |
Practical examples
Read a log
less /var/log/syslog
Opens a log in a scrollable pager.
View wide data
less -NS report.csv
Shows line numbers and avoids wrapping.
Follow output
less +F server.log
Tracks new log lines interactively.
Common mistakes
- Pressing Ctrl+C to quit instead of `q` and confusing follow mode behavior.
- Expecting edits in less; it is a viewer, not an editor.
Related commands
- catConcatenate files and write their contents to standard output.
- tailPrint the end of input and optionally follow appended data.
- manRead installed manual pages for commands, formats, and APIs.
- grepSearch text for lines matching a pattern.
- Where-ObjectFilter pipeline objects by property values or a script block predicate.
- Get-ContentRead file content or provider data as a stream of objects.
- echoWrite arguments and shell-expanded values to standard output.
- echoDisplay text or control command echoing in a batch script.
FAQ
What does less do in Linux?
Page through text interactively without loading it all at once.
How do I use less from the terminal?
Start with `less [OPTION]... [FILE]...`, then choose only the options needed for the task.
What is a practical less example?
Try `less /var/log/syslog` — Opens a log in a scrollable pager.
Can I use less in a shell script?
Yes. less works in Bash, sh, and Zsh, but scripts should handle quoting, errors, and command output explicitly.
Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.