More tips for less

You can also search for strings in less. If you want to search forward in the file, use /pattern. In order to seach backward, use ?pattern.

These can also be used when reading man pages. Try for example to search for the word search in the man page for less:

man less

As you see, less has many more possibilities for searches in text files. As I already mentioned in an earlier posting, pressing v in less opens the file in a text editor. You can first use / for searching the line to be edited. Then press v to edit the file at the line you just moved to.

No comments: