标签: linux copy
如何在Linux中复制文件,使其复制所有文件,或者如果所有文件都不存在,则应复制现有文件
目前我正在做如下:
cp {file1,file2} /origin /destination
但是如果没有任何一个文件,上面的命令会给出错误。我想告诉cp复制任何存在的文件,或者两者都复制。
cp
答案 0 :(得分:0)
查看find实用程序及其丰富的功能!阅读其手册:man find
find
man find
find {file1,file2} -exec cp {} destination/ \;