df -h
查看各分区使用率,df -i
检查inode占用。du -sh * | sort -rh
(当前目录),find / -type f -size +500M
(全局大文件)。journalctl --vacuum-time=7d
保留7天日志,或手动删除旧日志。sudo apt-get clean
(清除缓存),sudo apt-get autoremove
(卸载无用依赖)。sudo yum clean all
。sudo rm -rf /tmp/* /var/tmp/*
,谨慎操作避免影响运行中的程序。rm -rf ~/.cache/*
,清理浏览器、应用缓存。dpkg --list | grep linux-image
(Ubuntu)或 rpm -qa | grep kernel
(CentOS),删除旧版本内核。/etc/fstab
中添加noatime
选项减少磁盘访问记录,提升性能。