gdu

授权协议 MIT License
开发语言 Google Go
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 赫连飞沉
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

go DiskUsage()

CodeScene Code Health

Pretty fast disk usage analyzer written in Go.

Gdu is intended primarily for SSD disks where it can fully utilize parallel processing.However HDDs work as well, but the performance gain is not so huge.

asciicast

Installation

Head for the releases and download binary for your system.

Using curl:

curl -L https://github.com/dundee/gdu/releases/latest/download/gdu_linux_amd64.tgz | tar xz
chmod +x gdu_linux_amd64
mv gdu_linux_amd64 /usr/bin/gdu

Arch Linux:

yay -S gdu

Debian:

apt install gdu

Ubuntu

add-apt-repository ppa:daniel-milde/gdu
apt-get update
apt-get install gdu

NixOS:

nix-env -iA nixos.gdu

Homebrew:

brew install -f gdu
brew link --overwrite gdu  # if you have coreutils installed as well

Snap:

snap install gdu-disk-usage-analyzer
snap connect gdu-disk-usage-analyzer:mount-observe :mount-observe
snap connect gdu-disk-usage-analyzer:system-backup :system-backup
snap alias gdu-disk-usage-analyzer.gdu gdu

Binenv

binenv install gdu

Go:

go get -u github.com/dundee/gdu/v5/cmd/gdu

Usage

  gdu [flags] [directory_to_scan]

Flags:
  -h, --help                          help for gdu
  -i, --ignore-dirs strings           Absolute paths to ignore (separated by comma) (default [/proc,/dev,/sys,/run])
  -I, --ignore-dirs-pattern strings   Absolute path patterns to ignore (separated by comma)
  -f, --input-file string             Import analysis from JSON file
  -l, --log-file string               Path to a logfile (default "/dev/null")
  -m, --max-cores int                 Set max cores that GDU will use. 8 cores available (default 8)
  -c, --no-color                      Do not use colorized output
  -x, --no-cross                      Do not cross filesystem boundaries
  -H, --no-hidden                     Ignore hidden directories (beginning with dot)
  -p, --no-progress                   Do not show progress in non-interactive mode
  -n, --non-interactive               Do not run in interactive mode
  -o, --output-file string            Export all info into file as JSON
  -a, --show-apparent-size            Show apparent size
  -d, --show-disks                    Show all mounted disks
  -v, --version                       Print version

Examples

gdu                                   # analyze current dir
gdu -a                                # show apparent size instead of disk usage
gdu <some_dir_to_analyze>             # analyze given dir
gdu -d                                # show all mounted disks
gdu -l ./gdu.log <some_dir>           # write errors to log file
gdu -i /sys,/proc /                   # ignore some paths
gdu -I '.*[abc]+'                     # ignore paths by regular pattern
gdu -c /                              # use only white/gray/black colors

gdu -n /                              # only print stats, do not start interactive mode
gdu -np /                             # do not show progress, useful when using its output in a script
gdu / > file                          # write stats to file, do not start interactive mode

gdu -o- / | gzip -c >report.json.gz   # write all info to JSON file for later analysis
zcat report.json.gz | gdu -f-         # read analysis from file

Gdu has three modes: interactive (default), non-interactive and export.

Non-interactive mode is started automtically when TTY is not detected (using go-isatty), for example if the output is being piped to a file, or it can be started explicitly by using a flag.

Export mode (flag -o) outputs all usage data as JSON, which can then be later opened using the -f flag.

Hard links are counted only once.

File flags

Files and directories may be prefixed by a one-characterflag with following meaning:

  • ! An error occurred while reading this directory.

  • . An error occurred while reading a subdirectory, size may be not correct.

  • @ File is symlink or socket.

  • H Same file was already counted (hard link).

  • e Directory is empty.

Running tests

make test

Benchmarks

Benchmarks performed on 50G directory (100k directories, 400k files) on 500 GB SSD using hyperfine.See benchmark target in Makefile for more info.

Cold cache

Filesystem cache was cleared using sync; echo 3 | sudo tee /proc/sys/vm/drop_caches.

Command Mean [s] Min [s] Max [s] Relative
gdu -npc ~ 5.377 ± 0.479 5.132 6.719 1.07 ± 0.10
dua ~ 6.431 ± 0.015 6.417 6.465 1.28 ± 0.01
duc index ~ 30.432 ± 2.965 29.321 38.866 6.07 ± 0.59
ncdu -0 -o /dev/null ~ 29.435 ± 0.145 29.188 29.711 5.87 ± 0.06
diskus ~ 5.013 ± 0.042 4.948 5.087 1.00
du -hs ~ 29.445 ± 3.223 28.337 38.616 5.87 ± 0.64
dust -d0 ~ 6.673 ± 0.483 6.337 7.788 1.33 ± 0.10

Warm cache

Command Mean [ms] Min [ms] Max [ms] Relative
gdu -npc ~ 710.8 ± 11.0 692.8 730.7 1.67 ± 0.10
dua ~ 532.0 ± 16.5 496.6 551.2 1.25 ± 0.08
duc index ~ 1706.6 ± 23.2 1668.1 1729.3 4.01 ± 0.23
ncdu -0 -o /dev/null ~ 2399.4 ± 12.5 2388.5 2425.2 5.64 ± 0.32
diskus ~ 425.1 ± 23.7 393.3 469.7 1.00
du -hs ~ 1397.0 ± 19.6 1378.2 1435.5 3.29 ± 0.19
dust -d0 ~ 663.3 ± 9.8 645.0 679.5 1.56 ± 0.09

Alternatives

  • ncdu - NCurses based tool written in pure C
  • godu - Analyzer with carousel like user interface
  • dua - Tool written in Rust with interface similar to gdu (and ncdu)
  • diskus - Very simple but very fast tool written in Rust
  • duc - Collection of tools with many possibilities for inspecting and visualising disk usage
  • dust - Tool written in Rust showing tree like structures of disk usage
  • 利用g_mmpbsa 计算时的命令: 这里有一步法,也有三步法 三步法的命令: a:计算真空中的势能 g_mmpbsa -f md_0_100_center.xtc -s md_0_100.tpr -n index.ndx -pdie 2 -decomp 产生两个文件energy_MM.xvg and contrib_MM.dat b:计算极性溶剂化能 g_mmpbsa -f md_0_100_c

  • 1.命令简介 du(disk usage)用于查看指定的目录或文件所占用的磁盘空间。 2.命令格式 du [OPTIONS] [FILES] du [OPTIONS] --files0-from=F 3.选项说明 -a, --all 递归显示目录与其包含的所有文件及子目录的大小,默认仅显示目录及其子目录的大小。 --apparent-size 显示文件或目录自身大小,而不是它们占用的磁盘空间

  • Linux命令 du du命令也是查看使用空间的,但是与df命令不同的是Linux du命令是对文件和目录磁盘使用的空间的查看,还是和df命令有一些区别的。 语法du [选项][文件] 选项-a或-all 显示目录中个别文件的大小。 -b或-bytes 显示目录或文件大小时,以byte为单位。 -c或—total 除了显示个别目录或文件的大小外,同时也显示所有目录或文件的总和。 -k或—kilob

  • du:Disk Usage的缩写,命令功能为显示目录(或文件)所占磁盘空间的大小。 语  法:du [-abcDhHklmsSx0] [-L][-X File][--block-size=SIZE][--exclude=PATTERN] [--max-depth=N][--help][--version][FILE-OR-PATH] 参数说明: -0 每个结果显示后不换行 -a或–all  为每个

  • 一、命令简介   Linux du (英文全拼:disk usage)命令用于显示目录或文件的大小。du 会显示指定的目录或文件所占用的磁盘空间。参数的不同组合,可以更快的提高工作效率,以下仅列出了经常使用到的参数,如需更详细的信息,请用man du命令来获得。 二、使用示例 1、查看指定文件大小,默认单位K [root@centos7 home]# du -a fb.zip 809752 fb.

  • 1.作用 显示每个文件和目录的磁盘使用空间; 适用于linux及mac系统。 2.格式 2.1 du -h "文件或者目录名" 以K、M、G为单位显示文件或者目录大小。 不指定文件或者目录名时默认是当前目录下所有目录及文件夹,最后一行显示的是当前目录所有文件大小汇总。 vagrant@homestead:/vagrant/wangjianwen/test$ du -h 4.0K ./test

  • 在linux中执行du -sh发现文件夹有4GB,但执行du -sh *缺智能看到800MB,和df -h统计到的差异很大。 在linux上执行下面的命令即可统计隐藏文件大小: # 统计当前目录下所有文件大小 du -hs * .[^.]*

  • du目命令用于查看文件或目录的大小容量,du 会显示指定的目录或文件所占用的磁盘空间,其命令格式如下: du [OPTION]... [FILE]... 常用参数: -h:以人可视化的方式显示,以K,M,G为单位,提高信息的可读性等; -c: 除了显示个别目录或文件的大小外,同时也显示所有目录或文件的总和 -s:--summarize 仅显示总计,不加-s,默认情况下,du会统计目录下所有的文

  • 本文详细介绍了linux中du命令参数的用法,并用示例进一步说明其使用方法。 du -sh * 查看当前目录下的文件夹大小 du 命令 用途 概述磁盘使用。 语法 du [ -a | -s ] [ -k ] [ -m ] [ -g ][ -l ] [ -r ] [ -x ] [ -H | -L ][ File ... ] 描述 linux中du命令显示用于文件的块的数量。如果指定的File参数实际

  • 用法:du [OPTION]... [FILE]...  或:du [OPTION]... --files0-from=F 打印每个文件占用磁盘空间 -0, --null 每一行以空结束,而不是换行符 -a, --all 打印所有文件 --apparent-size 打印真实大小而不是磁盘使用大小。虽然

  • du命令也是查看使用空间的,但是与df命令不同的是Linux du命令是对文件和目录磁盘使用的空间的查看,还是和df命令有一些区别的。 语法 du [选项][文件] 选项 -a或-all 显示目录中个别文件的大小。 -b或-bytes 显示目录或文件大小时,以byte为单位。 -c或--total 除了显示个别目录或文件的大小外,同时也显示所有目录或文件的总和。 -k或--kilobytes 以K

  • du命令的英文全称是“Disk Usage”,即用于查看磁盘占用空间的意思。但是与df命令不同的是du命令是对文件和目录磁盘使用的空间的查看,而不是某个分区。 语法格式:du [参数] [文件] 常用参数: -a 显示目录中所有文件大小 -k 以KB为单位显示文件大小 -m 以MB为单位显示文件大小 -g 以GB为单位显示文件大小 -h 以易读方式显示文件大小 -s 仅显示总计 参考实例 以易

  • Linux du命令也是查看使用空间的,但是与df命令不同的是Linux du命令是对文件和目录磁盘使用的空间的查看,还是和df命令有一些区别的. 1.命令格式: du [选项][文件] 2.命令功能: 显示每个文件和目录的磁盘使用空间。 3.命令参数: -a或-all  显示目录中个别文件的大小。    -b或-bytes  显示目录或文件大小时,以byte为单位。    -c或--total 

  • du命令是“disk usage”的缩写,展示文件或目录使用的估计磁盘空间量。这对于查找占用大量磁盘空间的文件和目录很有用。 如何使用du命令 du命令的常规语法如下:du [OPTIONS]... FILE... 如果给定的FILE是目录,du则将汇总该目录中每个文件和子目录的磁盘使用情况。如果未FILE指定,du将报告当前工作目录的磁盘使用情况。 不带任何选项执行时du,以字节为单位显示给定文

  • 转载地址:http://www.lowxp.com/g/article/detail/290 常用命令 du -h --max-depth=1 |grep [TG] |sort   #查找上G和T的目录并排序 du -sh    #统计当前目录的大小,以直观方式展现   du -h --max-depth=1 |grep 'G' |sort   #查看上G目录并排序 du -sh --max-de

 相关资料
  • This project is obsolete. Please use 'gng' instead. Visit at gng What's gdub? gdub (gw on the command line) is a gradle / gradlew wrapper. Not to beconfused with the Gradle Wrapper, gw invokes ./gradl

  • 广东工业大学计算机学院课程攻略 给作者加鸡腿 �� : 目录 使用指南 资源分类 推荐阅读 了解工大更多 相关说明 支持开源 使用指南 内容的查找搜索: 使用浏览器进入仓库首页之后,按下快捷键t,进入文件搜索模式,输入你想要寻找的文件名或者文件夹名,即可实时展示搜索结果。 安装Octotree或者GiteeTree浏览器扩展插件,方便在网页上浏览项目的文件夹和文件 文件的下载: Online(国内

相关阅读

相关文章

相关问答

相关文档