xargs用法 练习笔记
2013-11-28 11:50
316 查看
# cd testdir
# ls
test
# touch test1
# ls
test test1
# ls | xargs -t rm
rm test test1
# ls
# touch test1
# touch test2
# ls
test1 test2
# touch test3
# ls
test1 test2 test3
# ls
test1 test2 test3
# ls | xargs -t -I {} mv {} {}.old
mv test1 test1.old
mv test2 test2.old
mv test3 test3.old
# ls
test1.old test2.old test3.old
#
删除创建时间超过30天的文件
# find . -type f -mtime +30 | xargs -t rm
查找哪些文件中包含Hello字符的文件
# find . -type f | xargs -t grep -l Hello
# ls
test
# touch test1
# ls
test test1
# ls | xargs -t rm
rm test test1
# ls
# touch test1
# touch test2
# ls
test1 test2
# touch test3
# ls
test1 test2 test3
# ls
test1 test2 test3
# ls | xargs -t -I {} mv {} {}.old
mv test1 test1.old
mv test2 test2.old
mv test3 test3.old
# ls
test1.old test2.old test3.old
#
删除创建时间超过30天的文件
# find . -type f -mtime +30 | xargs -t rm
查找哪些文件中包含Hello字符的文件
# find . -type f | xargs -t grep -l Hello
相关文章推荐
- POI设置excel添加列下拉框
- 开源中国iOS客户端学习——(七)MBProgressHUD特效
- jstack dump日志文件详解
- 输出给定图案
- linux grep 正则表达式
- ecshop 新增模板、设置模板
- 检查邮箱的有效性
- C#拉姆达(=>)表达式
- 手动调整SSAS Cube并行处理值提高运行效率
- iptables 防火墙
- linux copy
- 25种用户十秒离开你网站的原因
- qt中QString与String与int,double,char*之间的转换
- Bloomberg Launches Trading Platform for Derivatives Compliance
- Java 泛型快速排序 以sdut 1196为例
- IP地址 A\B\C类
- 简单认为是求墙之间水的容量
- String的思考
- IP地址 A\B\C类
- IP地址 A\B\C类