针对目录和子目录中的所有 txt 文件运行脚本 - BASH

1 bash

我想做的是类似的事情(这是伪代码):

for txt in  $(some fancy command ./*.txt); do
some command here $txt
Run Code Online (Sandbox Code Playgroud)

dev*_*ull 5

您可以使用find

find /path -type f -name "*.txt" | while read txt; do
  echo "$txt";   # Do something else
done
Run Code Online (Sandbox Code Playgroud)