less
What is less?
less: Less — View a file page by page — press q to quit, / to search. less shows a file one screen at a time. You scroll with the arrow keys or space bar, search with /, jump to the end with G, and quit with q. Unlike an editor, it does not load the whole file at once, so it opens multi-gigabyte log files instantly. It is also the pager behind man, git log and git diff.
Frequently asked questions about less
What should you keep in mind with less?
A few options help with logs. less +F file follows new lines like tail -f; press Ctrl+C to stop following and scroll, and F to resume. -S stops long lines from wrapping, which keeps wide logs readable, and -N shows line numbers. Because less cannot change the file, it is a safe way to inspect configuration and logs on a production server.
At a glance
| Category | CLI commands |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |