#Linux find命令,-exec执行多条命令
- 前面的执行成功才会执行后面的
find . -name "*.txt" -exec echo {} \; -exec grep banana {} \;
- 忽略错误执行
find . -name "*.txt" \( -exec echo {} \; -o -exec true \; \) -exec grep banana {} \;
find . -name "*.txt" -exec echo {} \; -exec grep banana {} \;
find . -name "*.txt" \( -exec echo {} \; -o -exec true \; \) -exec grep banana {} \;