Linux shell 搜索指定后缀名文件,并复制到指定目录。

1、find /目标目录 -name "*.a" -type f -exec cp {} /目标路径 \;

2、find /usr/local/src -name "*.a" -type f -exec cp {} /backup/libs \;

3、find /目标目录 -name "*.a" -type f -exec cp -p {} /目标路径 \;

4、find /目标目录 -name "*.a" -type f -print0 | xargs -0 cp -t /目标路径

5、find /目标目录 -name "*.a" -type f -exec cp -i {} /目标路径 \;

6、find /目标目录 -name "*.a" -type f -exec cp -u {} /目标路径 \;

远程复制(SCP)

7、find /目标目录 -name "*.a" -type f -exec scp {} user@remote:/目标路径 \;

相关推荐
学困昇1 小时前
Linux基础开发工具(下):调试器gdb/cgdb的使用详解
linux·运维·服务器·开发语言·c++
必胜刻1 小时前
Redis哨兵模式(Linux)
linux·数据库·redis
双翌视觉1 小时前
服务器电源外观检测智能化机器视觉解决方案
运维·服务器·人工智能·机器学习
dualven_in_csdn2 小时前
【数据库损坏】关于一次现场数据库损坏
数据库·mysql
锦衣夜行?2 小时前
oracle 未知长度从左到右截取某个字符串
数据库·oracle
Channing Lewis2 小时前
.ini文件格式
服务器
han_hanker2 小时前
@JsonIgnore,@JsonProperty, @JsonInclude,@JsonFormat
数据库·oracle
阿猿收手吧!2 小时前
【Linux】Ubuntu 24安装webbench
linux·运维·ubuntu
hanyi_qwe3 小时前
MySQL事务基础
数据库·mysql