Здесь полезен предикат -path
:
find. -path '*/ABC_MPSC/ABC.jpg'
Описание POSIXдля этого предиката:
The primary shall evaluate as true if the current pathname matches pattern using the pattern matching notation described in Pattern Matching Notation. The additional rules in Patterns Used for Filename Expansion do not apply as this is a matching operation, not an expansion.
Причина, по которой ваш -name "ABC_MPSC/ABC.jpg"
не удался, заключается в том, что предикат -name
:
shall evaluate as true if the basename of the current pathname matches pattern
Другими словами, -name
никогда не видит каталог текущего имени файла, только само базовое имя файла (ABC.jpg, например ).