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


posted on 2017-04-13 10:46  yutingliuyl  阅读(742)  评论(0编辑  收藏  举报