360 Secure SkillHub
360 安全技能中心

Linux Disk Doctor

面向 Linux 磁盘满/无剩余空间场景,提供排查与清理流程:用 df、du 定位占用,清理 apt 包缓存、旧内核、journal 日志、Docker 镜像与临时文件。内容以命令和简短说明为主,未给出文件系统扩容命令,也未说明备份或回滚方式。

分类:自动化
laolaoqi
laolaoqi
热度 1.20
最近更新 2026-05-08 11:41:50

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add laolaoqi/linux-disk-doctor
兼容性
通用兼容
联网要求
联网要求未确认
数据出网
数据不出本机
Metadata
name
linux-disk-doctor
description
Diagnose and fix Linux disk full / no space issues. Find large files, clean logs, purge package caches, remove old kernels, handle Docker disk bloat, and expand filesystems. Use when df -h shows space critically low, applications fail with "no space left on device", or docker builds fail with ENOSPC.

Linux Disk Doctor

Free disk space fast.

Quick Assessment

df -h
du -sh /* 2>/dev/null | sort -rh | head -20

Cleanup Steps

# Package cache
apt-get clean && apt-get autoremove -y

# Old kernels (keep current)
dpkg --list | grep linux-image | awk '{print $2}' | grep -v $(uname -r) | xargs apt-get purge -y

# Journal logs
journalctl --vacuum-time=7d

# Docker
docker system prune -a -f

# Temp files
rm -rf /tmp/*

# Find largest directories
du -sh /var/log/* | sort -rh | head -10

📢 Need Help?

Need OpenClaw deployed on your server? I offer managed deployment & hosting: