Linux 基础系统符号 | 竖线符号
| 竖线符号 (管道符号)
1. 表示管道符号,管道前面的命令交给后面执行
2. 经常配合xargs命令使用
find /opt -type f -name "*.txt" -delete
find /opt -type f -name "*.txt" -exec rm -rf {} \;
find /opt -type f -name "*.txt" | xargs rm -rf
echo ddd{01..10}
echo ddd{01..10} | xarges -n1
查找指定数据进行复制
find /opt -type f -name "*.txt" | xargs cp /opt/backup
#添加 -i {} 参数 让前面的结果 放到{} 里面
#将找到的信息放到cp 和最终目录中间
find /opt -type f -name "*.txt" | xargs -i cp {} /opt/backup/
#-t target
#利用cp指明数据最终保存目录信息
find /opt -type f -name "*.txt" | xargs cp -t /opt/backup
exec方法
find /opt -type f -name "*.txt" -exec cp -a {} /opt/backup \;
其他命令 如 MV 类似
上一篇:Linux 基础系统符号
2022-03-21
想必大家都想知道阿里云新用户如何租用便宜的服务器呢?对于阿里云服务器的新手用户来说,买到便宜且实用的...查看详情>
2022-03-09
2022年阿里云新人专属会场,上百款新人热销云产品专享价,0.26折起。目前阿里云改变了新用户的套路...查看详情>
2022-03-07
2022年阿里云3月份采购季来啦!为期一个月的采购季活动,我们给开发者和中小企业的客户朋友们准备了...查看详情>