360 Secure SkillHub
360 安全技能中心

Disk Usage

该 Skill 封装 du -sh 命令,用于查看指定文件或目录占用的磁盘空间,输出一行人类可读的 SIZE 与 PATH;成功返回退出码 0,路径不存在等失败情况返回非零退出码并给出错误信息。输入为单个路径参数,属于单轮调用。

jinwangmok
jinwangmok
热度 48.17
最近更新 2026-05-11 17:37:41
分类:数据依赖:代码执行应用场景:报告撰写 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add disk-usage
Metadata
name
disk-usage
version
1.0.0
description
Show disk usage of a directory or file in human-readable format. Use when the user wants to know how much space a folder or file takes.
allowed-tools
Bash(du:*)
metadata
{"openclaw":{"emoji":"💾","requires":{"bins":["du"],"env":[]},"install":[]}}

Disk Usage

Show how much disk space a directory or file uses with a single command.

Usage

du -sh <PATH>

Arguments:

# Name Description
1 PATH Path to file or directory to measure

Example

du -sh /home/user/projects

Output:

1.2G	/home/user/projects

Format: SIZE PATH

Success / Failure

  • Success: One line with human-readable size and path (exit code 0)
  • Failure: Error message (exit code non-zero, e.g. path not found)