# Linux commands: less

> Learn how the Linux less command shows a file in an interactive viewer, where you scroll, search with /, and press F for live follow mode like tail -f.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2020-08-31 | Topics: [CLI](https://flaviocopes.com/tags/cli/) | Canonical: https://flaviocopes.com/linux-command-less/

The `less` command is one I use a lot. It shows you the content stored inside a file, in a nice and interactive UI.

Usage: `less <filename>`.

![Terminal window showing the less command displaying a markdown file with frontmatter and content about bash shell scripting](https://flaviocopes.com/images/linux-command-less/Screenshot_2019-02-10_at_09.11.05.png)

Once you are inside a `less` session, you can quit by pressing `q`.

You can navigate the file contents using the `up` and `down` keys, or using the `space bar` and `b` to navigate page by page. You can also jump to the end of the file pressing `G` and jump back to the start pressing `g`.

You can search contents inside the file by pressing `/` and typing a word to search. This searches _forward_. You can search backwards using the `?` symbol and typing a word.

This command just visualises the file's content. You can directly open an editor by pressing `v`. It will use the system editor, which in most cases is `vim`.

Pressing the `F` key enters _follow mode_, or _watch mode_. When the file is changed by someone else, like from another program, you get to see the changes _live_. By default this is not happening, and you only see the file version at the time you opened it. You need to press `ctrl-C` to quit this mode. In this case the behaviour is similar to running the `tail -f <filename>` command.

You can open multiple files, and navigate through them using `:n` (to go to the next file) and `:p` (to go to the previous).

> This command works on Linux, macOS, WSL, and anywhere you have a UNIX environment
