To search in less, you can use the following commands:
-
Search for a pattern:
- Type
/followed by the pattern you want to search for and press Enter. For example, to search for "ERROR", type/ERROR.
- Type
-
Case-insensitive search:
- Start
lesswith the-ioption to make searches case-insensitive:less -i filename
- Start
-
Navigate through search results:
- Press
nto move to the next occurrence of the search term. - Press
Nto move to the previous occurrence.
- Press
-
Exit search mode:
- Press
qto exitlessand return to the terminal prompt.
- Press
These commands will allow you to efficiently find specific content within a file while using less.
