Closed hongyi-zhao closed 3 months ago
The --and
option applies to patterns, not to globs. The -g
option can be repeated to specify addtiional globs. Or you can use a comma to specify multiple globs like -g '*.py,**/pymatgen/**'
.
-g GLOBS, --glob=GLOBS, --iglob=GLOBS
Only search files whose name matches the specified comma-separated
list of GLOBS, same as --include=glob for each `glob' in GLOBS.
When a `glob' is preceded by a `!' or a `^', skip files whose name
matches `glob', same as --exclude='glob'. When `glob' contains a
`/', full pathnames are matched. Otherwise basenames are matched.
When `glob' ends with a `/', directories are matched, same as
--include-dir='glob' and --exclude-dir='glob'. A leading `/'
matches the working directory. Option --iglob performs
case-insensitive name matching. This option may be repeated and
^^^^^^^^^^^^^^^^^^^^^^^^^^^
may be combined with options -M, -O and -t to expand searches. See
`ugrep --help globs' and `man ugrep' section GLOBBING for details.
See below:
So, how to use
--and
with-g
?Regards, Zhao