我执行了#34;发现"命令为:
[root@XXXXX ~]# find / -name "dba-3.2.0.0.jar"
/abc/XXXXitrpwf/workflow/lib/dba-3.2.0.0.jar
/abc/XXXXitrprpt/reporting/lib/dba-3.2.0.0.jar
/abc/XXXXitrpmhost/technology/lib/dba-3.2.0.0.jar
/abc/XXXXitrpressvc/service/lib/dba-3.2.0.0.jar
/abc/XXXXitrpac/technology/lib/dba-3.2.0.0.jar
/abc/XXXXitrpui/services/ROOT/WEB-INF/lib/dba-3.2.0.0.jar
/abc/XXXXitrpdm/technology/lib/dba-3.2.0.0.jar
/abc/XXXXitrpsm/technology/lib/dba-3.2.0.0.jar
/abc/XXXXitrplic/licensing/lib/dba-3.2.0.0.jar
现在,我想在所有位置覆盖dba-3.2.0.0.jar
/tmp/dba-3.2.0.0.jar
。
我该怎么做?提前谢谢。
答案 0 :(得分:1)
您可以执行类似
的操作find / -name "dba-3.2.0.0.jar" -exec cp /tmp/dba-3.2.0.0.jar {} \;
{}
将被每个文件替换
答案 1 :(得分:0)
您可以使用xargs
find / -name "dba-3.2.0.0.jar" | xargs -I{} cp {} /destination/path
在Ubuntu 16.04上测试了命令
答案 2 :(得分:-1)
find / -name "nametofind" -exec cp {} /output/directory/goes/here \;