-exec
    1.参数是一个一个传递的,传递一个参数执行一次rm
    2.文件名有空格等特殊字符也能处理
-xargs 
    1.一次将参数传给命令,可以使用-n控制参数个数
    2.处理特殊文件名需要采用如下方式:
    find . -name "*.txt" print0 |xargs -0 rm {} 

find /opt/test/ -type f -name "*.txt" -exec cp {} /tmp \;

find /opt/test/ -type f -name "*.txt" | xargs -i cp {} /tmp

相关文章:

  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2021-10-08
  • 2021-11-24
  • 2022-01-18
  • 2022-12-23
  • 2022-01-13
猜你喜欢
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2021-11-24
  • 2021-11-24
  • 2022-12-23
相关资源
相似解决方案