在CentOS系统中,你可以使用find命令来查找大文件,并使用rm命令来删除它们。以下是一些示例:
find /path/to/directory -type f -size +100M
这里,/path/to/directory是你想要搜索的目录,-type f表示只查找文件,-size +100M表示查找大于100MB的文件。
find /path/to/directory -type f -size +100M > large_files.txt
find /path/to/directory -type f -size +100M -exec rm {} \;
.log文件),可以使用-name选项:find /path/to/directory -type f -size +100M -name "*.log" -exec rm {} \;
ls命令查看找到的文件:find /path/to/directory -type f -size +100M -exec ls -lh {} \;
请注意,在删除文件之前确保你真的想要删除这些文件,因为删除操作是不可逆的。建议先备份重要数据。