Если это просто иерархия папок с глубиной n (предположим, с глубиной 2), я считаю, что это полезно:
ls -laht --full-time */*
Это то, для чего предназначена опция -prune
:
find . -type d -name "avoid_this_directory_please" -prune -o -type f -print
В основном это говорит: «Если есть каталог с именем , избегайте_этого_каталога
, не вводите его, в противном случае, если это обычный файл, выведите его путь ".
Из человек находит
в разделе -path
, очевидно, объединяя два других ответа
To ignore a whole directory tree, use -prune rather than
checking every file in the tree. For example, to skip the directory
`src/emacs' and all files and directories under it, and print the
names of the other files found, do something like this:
find . -path ./src/emacs -prune -o -print
Попробуйте это
find -name "*.js" -not -path "./directory/*"
Чтобы избежать каталога, попробуйте выполнить тест -path:
find . -type f ! -path '*/avoid_this_directory_please/*'