项目
在 GitHub 查看
chenquan/diskusage
关于
💥 一款适用于 Linux、macOS 和 Windows 的磁盘使用情况查看工具,可快速找出占用空间最大的目录或文件。
开发工具实测星标增长
- 24小时
- 0
- 7天
- -1
- 15天
- -2
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README-CN.md
原文diskusage
English | 简体中文
💥一个显示磁盘使用情况的工具。(Linux、MacOS 和 Windows)

😜安装
go install github.com/chenquan/diskusage@latest
或者 下载.
👏如何使用
$ diskusage -h
A tool for showing disk usage.
GitHub: https://github.com/chenquan/diskusage
Issues: https://github.com/chenquan/diskusage/issues
Usage:
diskusage [flags]
Examples:
1.The maximum display unit is GB: diskusage -u G
2.Only files named doc or docx are counted:
a.diskusage -t doc,docx
b.diskusage -f ".+\.(doc|docx)$"
3.Supports color output to pipeline:
a.diskusage -c always | less -R
b.diskusage -c always | more
4.Displays a 2-level tree structure: diskusage -d 2
5.Specify the directory /usr: diskusage --dir /usr
6.Export disk usage to file: diskusage > diskusage.txt
Flags:
-a, --all display all directories, otherwise only display folders whose usage size is not 0
-c, --color string set color output mode. optional: auto, always, ignore (default "auto")
-d, --depth int shows the depth of the tree directory structure (default 1)
--dir string directory path (default "./")
-D, --directory only display directory
-f, --filter string regular expressions are used to filter files
-h, --help help for diskusage
-l, --limit int limit the number of files and directories displayed (default 9223372036854775807)
-r, --recursion automatically calculate directory depth, for recursively traversing all sub directories
-R, --reverse reverse the sort order, so the smallest files are listed first
-t, --type strings only count certain types of files (default all)
-u, --unit string displayed units. optional: B(Bytes), K(KB), M(MB), G(GB), T(TB) (default "M")
-v, --version version for diskusage
-w, --worker int number of workers searching the directory (default 32)
👀案例
- 只统计名为 doc 或 docx 的文件:
diskusage -t doc,docxordiskusage -f ".+\.(doc|docx)$" - 最大显示单位GB:
diskusage -u G - 支持颜色输出到管道:
diskusage -c always | less -Rordiskusage -c always | more
硬链接只统计一次:大小保留在路径字典序最小的链接上,其余链接显示为 0。
如果你喜欢或正在使用这个项目来学习或开始你的解决方案,请给它一个star⭐。谢谢!
探索相关项目
加载中…