디스크 사용량을 표시하는 도구입니다. (리눅스, 맥OS, 윈도우즈)

디스크 사용량을 표시하는 도구입니다. (리눅스, 맥OS, 윈도우즈)

2022-10-13 last update

4 minutes reading diskusage disk tooling go
이동을 사용하여 현재 디스크 사용량을 표시하는 도구를 개발하십시오.
https://github.com/chenquan/diskusage
이 프로젝트를 좋아하거나 사용하여 솔루션을 배우거나 시작하는 경우 별표를 주세요. 감사!



❗설치




go install github.com/chenquan/[email protected]


👏사용법




$ diskusage -h
A tool for showing disk usage.

Usage:
  diskusage [flags]

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      dir path (default "./")
  -f, --filter string   regular expression filter (default ".+")
  -h, --help            help for diskusage
  -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")


👀예시


  • Doc 또는 docx라는 파일만 계산됩니다. diskusage -t doc,docx 또는 diskusage -f ".+\.(doc|docx)$"
  • 최대 표시 단위는 GM입니다. diskusage -u G
  • 파이프라인에 대한 색상 출력 지원: diskusage -c always | less -R 또는 diskusage -c always | more