linux的find基本使用

时间:2021-04-15 15:30:33   收藏:0   阅读:31
#打包非空的日志文件
find /www/wwwroot/tp/runtime/logs -type f -print0 | xargs --null tar -zcvf logs.tar.gz

#查找文件内容
find /www/wwwroot/tp -type f -name "*.php" |xargs grep "password"

#查找文件并删除
find /www/wwwroot/tp -name "*.exe" -exec mv {} /www/wwwroot/tp/del \;
#-exec 和 \; 之间包裹find的子命令 {}是find的结果

原文:https://www.cnblogs.com/sxfenglei/p/14661553.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!