Это - на самом деле путь find
работы по умолчанию. Вы могли просто работать
find A/ -name "*.jil" -exec cp {} target_dir/ \;
Поведение по умолчанию find
должен изучить все подкаталоги рекурсивно, можно управлять этим путем установки -maxdepth
/-midepth
опции:
-maxdepth levels
Descend at most levels (a non-negative integer) levels of direc‐
tories below the command line arguments. -maxdepth 0
means only apply the tests and actions to the command line
arguments.
-mindepth levels
Do not apply any tests or actions at levels less than levels (a
non-negative integer). -mindepth 1 means process all files
except the command line arguments.
С помощью ls
вы можете:
ls -c -ltd -- *PRO*.PLI
С помощью find
:
find . ! -name . -prune -type f -name '*PRO*.PLI'
(обратите внимание, что find
будет включать скрытые файлы, такие как .xPRO.PLI
, в то время как глобус оболочки ( * PRO * .PLI
) не будет по умолчанию).