A long file runs off the top of the screen, and its beginning is gone from view. In less you page through such a file and search it for a word.
less is a pager: it shows text one screen at a time. While it is open, it reads the keys:
| Key | What it does |
|---|---|
| Space, b | one screen forward, one screen back |
| ↑ ↓ | one line back, one line forward |
| g, G | to the start, to the end of the text |
| /word, then Enter | search forward |
| n | next match |
| q | quit |
All the keys are lowercase letters except G, which you type with Shift. (END) at the bottom means you are at the end of the text — you still quit with q. Viewing does not change the file.
Find the second match
In ~/terminal-practice, open the log terminal-notes.txt in less: type less term and complete the name with Tab. Search for the lines with TARGET — there are two — and read the value in the second match. Quit less.