凡自治之物 · LGD 治理学 · 创造术家族 | 评测协议:见平台质量门禁规范
English
When to use
Use it whenever you need to analyze local or remote disk space usage — in particular to hunt for unknown large files or to rank subdirectories by size. Fits the moments when the system warns that storage is running low, when old data needs archiving, or when server operations need to assess disk health. Because it is zero-dependency and strictly read-only, it can run a safe probe quickly on any system with no special network constraints.
Usage
Invoke the script directly: python disk_scan.py. Use -p <dir> to set the scan root (defaults to the current directory). Use --top <number> to cap the number of largest files returned — 100 is recommended to balance speed and precision. Add --recursive to force traversal of deep substructures. Run -h for the standard help text.
Workflow
- Confirm the target disk path and open the matching shell or SSH session.
- Run
python disk_scan.py -p /mnt/data -n 50 --recursiveto start the scan. - Watch the console log, focusing on how file sizes compare against total capacity.
- Read the generated ranking list; extract the paths and sizes of the top-ten largest files.
- Based on the subdirectory ranking, decide whether the space hog is a single file or a pile-up in folders.
- Turn the findings into a cleanup plan or export a report, closing the loop on the space investigation.
Evidence & safety statement
- Evidence: TBD (no evaluation / badge link yet; update here once it is produced)
- Version: 1.0.5
- Security: no independent security scan has been performed (TBD); the conclusion is pending and no endorsement is given until it is completed.
中文
何时用
适用于需要分析本地或远程磁盘空间占用情况,特别是排查未知大文件或统计子目录大小排名的场景。当系统提示存储空间不足、需清理归档旧数据、或服务器运维中评估磁盘健康状态时使用本技能。因其零依赖且为只读模式,适合在任何没有特定网络环境限制的系统上快速执行安全探查。
用法
直接调用脚本命令:python disk_scan.py。支持参数 -p <目录路径> 指定扫描目标根目录,默认为当前目录;使用 --top <数字> 设置大文件返回数量上限,推荐设为 100 以平衡性能与精度;添加 --recursive 参数可强制遍历深层子结构。若需查看具体命令帮助信息,请调用 -h 参数获取标准配置说明。
流程
- 确认目标磁盘路径并进入对应的命令行环境或 SSH 会话。
- 执行脚本
python disk_scan.py -p /mnt/data -n 50 --recursive启动扫描进程。 - 等待控制台输出终端日志,重点关注文件占用大小与总容量对比。
- 查看生成的排名列表,提取前十大大文件的具体路径及大小数值。
- 根据子目录排行数据判断占用源头是单点文件还是文件夹堆积。
- 依据分析结果规划清理策略或导出报告,完成空间排查任务闭环。
证据与安全声明
- 证据:TBD(暂无评测/徽章链接;产生后在此更新实际链接)
- 版本:1.0.5
- 安全:未做独立安全扫描(TBD),结论待补;补全前不作推荐背书。
