linux - Pattern search within directory -
how find particular pattern in files , sub-directories within directory?
exact word can searched using find grep , exec.
how find below:
'match=true'
there may or may not multiple spaces around '='.
this finds match=true
0 or more (*
) whitespace characters (\s
) around equals sign (tab, although uncommon between non-whitespace characters, valid character around equals sign in many languages):
grep 'match\s*=\s*true'
if want match 0 or 1 whitespace, can use \?
instead of *
above.
Comments
Post a Comment