扫码关注官方订阅号
我使用下列语句查找某个目录的大文件:
find . -type f -exec ls -s {} \; | sort -n -r | head -5
但是如果我想排除其中的目录: .git/,应该加什么呢?
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
一般的,过滤隐藏文件:
find . -not -path '*/\.*'
按文件大小排序:
find . -type f | xargs du | sort -rn | head
合起来:
find . -not -path '*/\.*' -type f | xargs du | sort -rn | head
find . -path ./.git -prune -o -type f -exec ls -s {} \; | sort -n -r | head -5
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
一般的,过滤隐藏文件:
按文件大小排序:
合起来: