Reputation: 2345
Given the following commands:
ls | grep ^b[^b]*b[^b]
ls | grep ^b[^b]*b[^b]*
I know that ^ marks the start of the line, but can anyone give me a brief explanation about these commands? what do they do? (Step by step)
thanks!
Upvotes: 1
Views: 226
Reputation: 393134
^
can mean two things:
[]
)So, it means:
It will match
bb
bzzzzzb
bzzzzzbzzzzzzz
but not
zzzzbb
bzzzzzxzzzzzz
Upvotes: 4
Reputation: 67231
1)starts with b and name continues with a 0 or more characters which are not b and then b and then continues with a character which is not b
2)starts with b and name continues with a 0 or more characters which are not b and then b and then continues with 0 or more characters which are not b
Upvotes: 0