Как найти структуру каталогов в Linux

Идентификаторы процессов уникальны.

Согласно документации 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.

...

0
28.09.2020, 12:21
3 ответа

Тест -nameсоответствует только последнему компоненту пути. Чтобы соответствовать чему-то вроде abc/def, вам понадобится-path:

$ mkdir -p somedir/otherdir/abc/def/ghi
$ find somedir -path '*/abc/def'
somedir/otherdir/abc/def
6
18.03.2021, 23:02

Как насчет этого.

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.

0
18.03.2021, 23:02
tree <base dir>
       -L level
             Max display depth of the directory tree.
       -P pattern
              List  only those files that match the wild-card pattern.

0
18.03.2021, 23:02

Теги

Похожие вопросы