Page through file content interactively with search and navigation.
low risk
less is an interactive file viewer that loads files page-by-page (unlike cat). Supports forward/backward navigation, regex search with /, and following live files with F. Handles arbitrarily large files efficiently.
| Flag | Meaning |
|---|---|
-N --line-numbers | Show line numbers |
-S --chop-long-lines | Don't wrap long lines |
-i --ignore-case | Case-insensitive search |
-F --quit-if-one-screen | Exit if content fits on screen |
less /var/log/syslogBrowse syslog interactively · explain & risk-check →kubectl logs pod-name | lessPage through pod logs · explain & risk-check →less -N +/ERROR app.logOpen with line numbers, jump to first ERROR · explain & risk-check →less +F /var/log/app.logStart in follow mode (like tail -f) · explain & risk-check →Inside less, press `F` to enter follow mode (like tail -f), then `Ctrl+C` to stop following and browse backward — the best of both worlds.
Reference text is hand-written and may be incomplete — check man less for your version. Test destructive commands on a non-production system first.