2

When searching through the output of more command how can I search for a phrase that includes spaces in between? When I search for a phrase like "typedef struct audiodev" it doesn't find the phrase in the file and I'm assuming this is because I need to express the space between the words with a certain symbol.

A1A2A3A4
  • 153
  • 1
  • 1
  • 5

3 Answers3

1

I'd use a regexp to match spaces:

egrep 'typedef\s+struct\s+audiodev' your_file

Here \s+ corresponds to one or more spaces

0

You can combine the command more with other tools like grep.

Open a console and try:

more yourfile | grep "typedef struct audiodev"
LnxSlck
  • 12,256
0

In the search function of more, spaces (all special characters actually) need to be escaped, so you could search like this:

/typedef\ struct\ audiodev
terdon
  • 100,812