码迷,mamicode.com
首页 > 系统相关 > 详细

Linux递归解压缩一个目录下的全部文件

时间:2017-04-13 10:50:15      阅读:269      评论:0      收藏:0      [点我收藏+]

标签:解压缩   bsp   targe   内容   color   linu   find   blog   gunzip   

gunzip -r hongchangfirst/data


怎样递归删除那些剩余的非log结尾的文件?

先列出确认一下:

find hongchangfirst/data -type f ! -name "*.log"

然后真正的删除:

find hongchangfirst/data -type f ! -name "*.log" -exec rm -f {} \;


记住后边-exec一定要加空格,否则会出现find: missing argument to `-exec‘错误。


怎样把一个目录下的全部文件的内容都合并到一个大文件里?

find 04 -type f -name "wire.log.*"  | xargs cat > ../all_logs


原文:http://blog.csdn.net/hongchangfirst/article/details/25104557

作者:hongchangfirst

hongchangfirst的主页:http://blog.csdn.net/hongchangfirst


Linux递归解压缩一个目录下的全部文件

标签:解压缩   bsp   targe   内容   color   linu   find   blog   gunzip   

原文地址:http://www.cnblogs.com/yutingliuyl/p/6702832.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!