Идентификаторы процессов уникальны.
Согласно документации POSIX fork()
:
DESCRIPTION
The fork() function shall create a new process. The new process (child process) shall be an exact copy of the calling process (parent process) except as detailed below:
- The child process shall have a unique process ID.
- The child process ID also shall not match any active process group ID.
- The child process shall have a different parent process ID, which shall be the process ID of the calling process.
...
Тест -name
соответствует только последнему компоненту пути. Чтобы соответствовать чему-то вроде abc/def
, вам понадобится-path
:
$ mkdir -p somedir/otherdir/abc/def/ghi
$ find somedir -path '*/abc/def'
somedir/otherdir/abc/def
Как насчет этого.
find /home/dir1/ -type d | grep 'abc/def'
или ff вы хотите перечислить каталоги только до определенной глубины.
find /home/dir1/ -maxdepth 2 -type d | grep 'abc/def'
-d - directory
-maxdepth levels of directories below the starting-points.
tree <base dir>
-L level
Max display depth of the directory tree.
-P pattern
List only those files that match the wild-card pattern.