How can I simplify below find command with pattern:
find . -type d -name symbols -o -name symbol
The pattern is 'symbol' 0 or 1 's'.
CodePudding user response:
You can use a -regex
, but it must match the whole path, so you need to prepend .*/
to match the path.
find . -type d -regex '.*/symbols?'