linux – 在/ home /中查找大型文件(> 100 MB)以进行“清理”

如何在/ home /中找到大型文件(> 100 MB)进行“清理”?

这是Centos 6.x.我尝试了一些命令,但它们没有用.

解决方法

Find有它自己的-delete选项
find /home -type f -size +100M -delete

应该做你想做的事.请注意放置-delete选项的位置

Warnings: Don’t forget that the find command line is evaluated
as an expression,so putting -delete first will make find try to
delete everything below the starting points you specified.

如果你想在使用它之前测试它,那么你需要添加-depth,因为-delete暗示它.

find /home -type f -size +100M -depth

相关文章

1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...
如何抑制stable_secret读取关键的“net.ipv6.conf.all.stabl...
1 删除0字节文件 find -type f -size 0 -exec rm -rf {} ...
## 步骤 1:安装必要的软件包 首先,需要确保系统已安装 `dh...