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


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
  • 2022-12-23
  • 2022-12-23
  • 2021-08-24
  • 2021-12-16
  • 2021-10-10
猜你喜欢
  • 2021-06-05
  • 2021-08-20
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
相关资源
相似解决方案