[UNIX] 如何找出当前用户下占用空间最大的文件?

[复制链接]
查看11 | 回复4 | 2005-10-30 17:05:33 | 显示全部楼层 |阅读模式
有时系统老报空间不足,用du检查空间不足,要删除些无用的大文件,可是用ls等命令很麻烦也很困难。
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
I usually use :
du -k . |sort -rn |more
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
Instead of doing it manually each time, you will like to get it done regularly by the box itself.
You can use find to list the files larger than a certain quota and last access time older than 20 days and then remove them. But be careful when implementing it, don't touch the system dirs etc.
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
#find / -size +n -print
n=需查找文件大小bytes/ 512bytes
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行