Skip to main content

Command referenceless

less command (Linux / bash / sh / zsh)

Linuxbashshzshtextbeginner

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 / optionMeaning
-NShow line numbers.
-SChop long lines instead of wrapping.
-iIgnore case in searches unless uppercase is used.
+FFollow 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.

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.