7

I'm using less to view a large file and I want to search for a pattern with wildcards — e.g., " x 1??" where ? is any character. Does less support that, and if so how would I do that interactively?

3
  • 3
    less search is regex so x 1.. Commented Apr 6, 2015 at 15:30
  • You may find this helpful: linux.about.com/library/cmd/blcmdl1_less.htm Commented Apr 6, 2015 at 15:42
  • 1
    Not quite a duplicate: I wasn't able to determine through previous searching that less search uses regex, so @jordanm has the answer. Could he post it as such? Commented Apr 6, 2015 at 23:20

1 Answer 1

11

The search in less uses regular expressions. To accomplish the search you are looking for, simply replace the shell wildcard ? with ..

/x 1.. 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.