Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chenquan/diskusage
💥A tool for showing disk usage(Linux, MacOS and Windows), it is a very fast utility to find largest directories or files.
https://github.com/chenquan/diskusage
cli command-line disk disk-space disk-usage diskusage file go golang linux macos tool windows
Last synced: 3 days ago
JSON representation
💥A tool for showing disk usage(Linux, MacOS and Windows), it is a very fast utility to find largest directories or files.
- Host: GitHub
- URL: https://github.com/chenquan/diskusage
- Owner: chenquan
- License: apache-2.0
- Created: 2022-08-04T00:30:29.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-12-11T00:42:50.000Z (11 days ago)
- Last Synced: 2024-12-11T01:29:31.203Z (11 days ago)
- Topics: cli, command-line, disk, disk-space, disk-usage, diskusage, file, go, golang, linux, macos, tool, windows
- Language: Go
- Homepage:
- Size: 782 KB
- Stars: 277
- Watchers: 5
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README-CN.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ops - chenquan/diskusage - 2.0|271|2022-08-04|2024-10-05 | 💥 显示磁盘使用情况的工具(Linux、MacOS 和 Windows),是一个查找最大目录或文件的非常快速的工具 | (终端命令行工具)
README
# diskusage
[![Release](https://img.shields.io/github/v/release/chenquan/diskusage.svg?style=flat-square)](https://github.com/chenquan/diskusage)
[![Download](https://goproxy.cn/stats/github.com/chenquan/diskusage/badges/download-count.svg)](https://github.com/chenquan/diskusage)
[![GitHub](https://img.shields.io/github/license/chenquan/diskusage)](LICENSE)[English](README.md) | 简体中文
💥一个显示磁盘使用情况的工具。(Linux、MacOS 和 Windows)
![](image/linux-pipe-more.png)
![](image/only-dir.png)
![](image/interactive.png)## 😜安装
```shell
go install github.com/chenquan/diskusage@latest
```或者 [下载](https://github.com/chenquan/diskusage/releases).
## 👏如何使用
```
$ diskusage -h
A tool for showing disk usage.GitHub: https://github.com/chenquan/diskusage
Issues: https://github.com/chenquan/diskusage/issuesUsage:
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.txtFlags:
-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
-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)
```## 👀案例
1. 只统计名为 doc 或 docx 的文件: `diskusage -t doc,docx` or `diskusage -f ".+\.(doc|docx)$"`
2. 最大显示单位GB: `diskusage -u G`
3. 支持颜色输出到管道: `diskusage -c always | less -R` or `diskusage -c always | more`如果你喜欢或正在使用这个项目来学习或开始你的解决方案,请给它一个star⭐。谢谢!