disk

disk 显示所选路径所在文件系统的容量;加上 -r 后,再单独计算目录内容大小。

诊断版本 1.2.3稳定
lil-terminal

概览

文件系统剩余空间与目录大小是两个不同问题。用 disk <path> 查看前者,仅在需要受限的递归计算时再加 -r。

文件系统容量与目录大小

文件或目录位于某个文件系统中。Total、Used、Free 描述整个文件系统,而目录大小只描述某一路径下的内容。disk 将两种测量分开;递归扫描有上限,也不会跟随符号链接。

语法

lil-terminal
disk [path] [-r] [-b]

参考

disk

显示当前目录所在文件系统的容量

disk <path>

显示所选文件或目录所在文件系统的容量

disk <dir> -r

另外递归计算所选目录内容的大小

-r

遍历目录但不跟随符号链接

-b

显示精确字节数

交互式 sandbox 预览

可直接在页面中运行预先准备的示例。结果已预先生成并在浏览器中显示;服务器不会执行任何终端命令。

比较文件系统容量与目录大小

安装与管理

安装当前兼容版本。完整功能请选择 Base,精简包请选择 Minimum;已安装模块的更新请使用 upgrade。

Base 与 Minimum 是同一当前模块版本的两个包。

Base 包

安装包含本地参考和全部已发布模式的完整包。

install disk
Minimum 包

安装精简包。该包不包含本地参考;help <cmd> -i 会打开当前服务器参考。

install disk -m
精确公开版本

安装这个确切的已发布版本。

install disk -v 1.2.3
检查或升级

让 upgrade 检查兼容性,仅在需要时替换已安装块。

upgrade disk
删除模块

删除扩展块,不影响核心和其他模块。

install disk -u

示例

示例可复制,但网站不会执行。请先检查路径、权限和破坏性选项。

比较文件系统容量与目录大小
disk
教学示例 — 服务器、时间和磁盘数据因主机而异
Path   sandbox
Total  31.5 GB
Used   1.7 GB (5.5%)
Free   29.7 GB
显示所选文件或目录所在文件系统的容量
disk sandbox
教学示例 — 服务器、时间和磁盘数据因主机而异
Path   sandbox/
Total  31.5 GB
Used   1.7 GB (5.5%)
Free   29.7 GB
显示所选文件或目录所在文件系统的容量
disk sandbox/config
教学示例 — 服务器、时间和磁盘数据因主机而异
Path   sandbox/config
Total  31.5 GB
Used   1.7 GB (5.5%)
Free   29.7 GB
显示所选文件或目录所在文件系统的容量
disk sandbox/config/app.ini
教学示例 — 服务器、时间和磁盘数据因主机而异
Path   sandbox/config/app.ini
Total  31.5 GB
Used   1.7 GB (5.5%)
Free   29.7 GB
处理不存在的路径
disk sandbox/data
教学示例 — 服务器、时间和磁盘数据因主机而异
Path   sandbox/data
Total  31.5 GB
Used   1.7 GB (5.5%)
Free   29.7 GB
另外递归计算所选目录内容的大小
disk sandbox/data -r
教学示例 — 服务器、时间和磁盘数据因主机而异
Path         sandbox/data
Total        31.5 GB
Used         1.7 GB (5.5%)
Free         29.7 GB

Items        3
Files        3
Directories  0
Links        0
Size         261 B (261 b)
另外递归计算所选目录内容的大小
disk sandbox/images -r
教学示例 — 服务器、时间和磁盘数据因主机而异
Path         sandbox/images
Total        31.5 GB
Used         1.7 GB (5.5%)
Free         29.7 GB

Items        4
Files        4
Directories  0
Links        0
Size         1.8 KB (1 840 b)
另外递归计算所选目录内容的大小
disk sandbox/config -r
教学示例 — 服务器、时间和磁盘数据因主机而异
Path         sandbox/config
Total        31.5 GB
Used         1.7 GB (5.5%)
Free         29.7 GB

Items        20
Files        20
Directories  0
Links        0
Size         513.5 KB (525 857 b)
显示精确字节数
disk sandbox/data -b
教学示例 — 服务器、时间和磁盘数据因主机而异
Path   sandbox/data
Total  33 770 192 896 B
Used   1 872 125 952 B (5.5%)
Free   31 898 066 944 B
另外递归计算所选目录内容的大小
disk sandbox/data -r -b
教学示例 — 服务器、时间和磁盘数据因主机而异
Path         sandbox/data
Total        33 770 192 896 B
Used         1 872 125 952 B (5.5%)
Free         31 898 066 944 B

Items        3
Files        3
Directories  0
Links        0
Size         261 B
显示精确字节数
disk sandbox -b
教学示例 — 服务器、时间和磁盘数据因主机而异
Path   sandbox/
Total  33 770 192 896 B
Used   1 872 125 952 B (5.5%)
Free   31 898 066 944 B
另外递归计算所选目录内容的大小
disk sandbox/config/app.ini -r
教学示例 — 服务器、时间和磁盘数据因主机而异
Recursive usage requires a directory
显示所选文件或目录所在文件系统的容量
disk sandbox/not-found
教学示例 — 服务器、时间和磁盘数据因主机而异
Path not found
显示所选文件或目录所在文件系统的容量
disk sandbox/data -z
教学示例 — 服务器、时间和磁盘数据因主机而异
Unknown option: -z
显示所选文件或目录所在文件系统的容量
disk sandbox/data sandbox/images
教学示例 — 服务器、时间和磁盘数据因主机而异
?
另外递归计算所选目录内容的大小
disk sandbox/config -b -r
教学示例 — 服务器、时间和磁盘数据因主机而异
Path         sandbox/config
Total        33 770 192 896 B
Used         1 872 125 952 B (5.5%)
Free         31 898 066 944 B

Items        20
Files        20
Directories  0
Links        0
Size         525 857 B

本示例使用的文件: sandbox/README.txt

该示例使用受保护的 /sandbox/ 文档工作区中的文件或目录。

lil-terminal documentation sandbox

This directory is part of the server tree: website_e36e9fed/sandbox/.
It is never included in generated lil-terminal downloads and direct HTTP access is blocked.
The documentation renderer reads only explicitly allow-listed files from here and
uses them to show real, reproducible command examples.

The fixtures are intentionally small and contain no secrets. They cover PHP, HTML,
CSS, JavaScript, JSON, INI, SQL, Python, shell, XML/SVG, CSV, plain text, logs,
images, .lil workflows, archives and temporary work paths.

During module review, examples may be refined together with the command. Keep paths
stable whenever possible because public documentation links refer to them.

相关文档

当前公开版本

v1.2.32026-10-31

Exact byte totals

disk -b reports exact filesystem byte counts, and combines with -r for exact recursive usage.