Using find with -exec {}, is there a way to count the total?

后端 未结 5 645
无人共我
无人共我 2020-12-29 18:48

I am using a command similar to this one:

find . -name \"*.php\" -exec chmod 755 {} \\;

Although, I am not using chmod, I am using a differ

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-29 19:34

    find . -name "*.php" -exec chmod 755 {} + -printf '.' | wc -c
    

    If you use + instead of ";", find will try to process chmod 755 on many files in parallel.

    You can perform additional commands after the first one, here, for example print a dot, and count the dots in the end.

提交回复
热议问题