显示 目录 大小 du

[root@hadoop1 /]# du -BG  -d 1
1G ./boot
0G ./dev
63G ./home
du: 无法访问"./proc/6689/task/6689/fd/4": 没有那个文件或目录
du: 无法访问"./proc/6689/task/6689/fdinfo/4": 没有那个文件或目录
du: 无法访问"./proc/6689/fd/4": 没有那个文件或目录
du: 无法访问"./proc/6689/fdinfo/4": 没有那个文件或目录
0G ./proc
1G ./run
0G ./sys
1G ./etc
10G ./root
1G ./tmp
1G ./var
11G ./usr
0G ./media
5G ./mnt
0G ./opt
0G ./srv
2G ./data
0G ./data0
89G .
[root@hadoop1 /]#

[root@hadoop1 /]# du -BG  -d 2
1G ./boot/grub
1G ./boot/grub2
1G ./boot
0G ./dev/net
0G ./dev/vfio
0G ./dev/snd
0G ./dev/mqueue
0G ./dev/hugepages
0G ./dev/centos
0G ./dev/disk
0G ./dev/block
0G ./dev/bsg
0G ./dev/dri
0G ./dev/char
0G ./dev/mapper
0G ./dev/pts
0G ./dev/shm
0G ./dev/input
0G ./dev/bus
0G ./dev/raw
0G ./dev/cpu
0G ./dev
3G ./home/trunk
36G ./home/data
1G ./home/personas
5G ./home/hadoop
63G ./home
0G ./proc/ipmi
0G ./proc/scsi
0G ./proc/acpi
0G ./proc/irq
0G ./proc/sys
0G ./proc/bus
0G ./proc/tty
0G ./proc/driver
0G ./proc/fs
0G ./proc/sysvipc
0G ./proc/1
0G ./proc/2
0G ./proc/3
0G ./proc/5
0G ./proc/7
0G ./proc/8
0G ./proc/9
0G ./proc/10
0G ./proc/11
0G ./proc/12
0G ./proc/13
0G ./proc/14
0G ./proc/15
0G ./proc/16
0G ./proc/17
0G ./proc/18
0G ./proc/19
0G ./proc/20
0G ./proc/21
0G ./proc/22
0G ./proc/23
0G ./proc/24
0G ./proc/25
0G ./proc/26
0G ./proc/27
0G ./proc/28
0G ./proc/29
0G ./proc/30
0G ./proc/31
0G ./proc/32
0G ./proc/33
0G ./proc/34
0G ./proc/35
0G ./proc/36
0G ./proc/37
0G ./proc/38
0G ./proc/39
0G ./proc/40
0G ./proc/41
0G ./proc/42
0G ./proc/43
0G ./proc/44
0G ./proc/45
0G ./proc/48
0G ./proc/49
0G ./proc/50
0G ./proc/52
0G ./proc/53
0G ./proc/54
0G ./proc/55
0G ./proc/58
0G ./proc/59
0G ./proc/60
0G ./proc/62
0G ./proc/63
0G ./proc/64
0G ./proc/65
0G ./proc/67
0G ./proc/68
0G ./proc/69
0G ./proc/70
0G ./proc/72
0G ./proc/73
0G ./proc/74
0G ./proc/75
0G ./proc/77
0G ./proc/78
0G ./proc/79
0G ./proc/80
0G ./proc/81
0G ./proc/82
0G ./proc/83
0G ./proc/84
0G ./proc/85
0G ./proc/86
0G ./proc/91
0G ./proc/92
0G ./proc/93
0G ./proc/94
0G ./proc/95
0G ./proc/96
0G ./proc/104
0G ./proc/107
0G ./proc/111
0G ./proc/112
0G ./proc/131
0G ./proc/167
0G ./proc/351
0G ./proc/353
0G ./proc/362
0G ./proc/363
0G ./proc/364
0G ./proc/365
0G ./proc/366
0G ./proc/367
0G ./proc/368
0G ./proc/370
0G ./proc/371
0G ./proc/372
0G ./proc/373
0G ./proc/374
0G ./proc/378
0G ./proc/382
0G ./proc/383
0G ./proc/396
0G ./proc/476
0G ./proc/477
0G ./proc/486
0G ./proc/487
0G ./proc/499
0G ./proc/501
0G ./proc/502
0G ./proc/503
0G ./proc/504
0G ./proc/505
0G ./proc/506
0G ./proc/507
0G ./proc/508
0G ./proc/511
0G ./proc/579
0G ./proc/597
0G ./proc/611
0G ./proc/637
0G ./proc/656
0G ./proc/671
0G ./proc/712
0G ./proc/713
0G ./proc/714
0G ./proc/715
0G ./proc/717
0G ./proc/718
0G ./proc/719
0G ./proc/730
0G ./proc/731
0G ./proc/732
0G ./proc/733
0G ./proc/734
0G ./proc/735
0G ./proc/747
0G ./proc/769
0G ./proc/772
0G ./proc/774
0G ./proc/775
0G ./proc/777
0G ./proc/785
0G ./proc/791
0G ./proc/792
0G ./proc/801
0G ./proc/802
0G ./proc/951
0G ./proc/974
0G ./proc/981
0G ./proc/985
0G ./proc/992
0G ./proc/1015
0G ./proc/1031
0G ./proc/1141
0G ./proc/1240
0G ./proc/1395
0G ./proc/1522
0G ./proc/1833
0G ./proc/2015
0G ./proc/2073
0G ./proc/2111
0G ./proc/2137
0G ./proc/2141
0G ./proc/2142
0G ./proc/2145
0G ./proc/2152
0G ./proc/2160
0G ./proc/2165
0G ./proc/2171
0G ./proc/2183
0G ./proc/2213
0G ./proc/2281
0G ./proc/2421
0G ./proc/2492
0G ./proc/2531
0G ./proc/2533
0G ./proc/2536
0G ./proc/2538
0G ./proc/2542
0G ./proc/2543
0G ./proc/2768
0G ./proc/2846
0G ./proc/2851
0G ./proc/2855
0G ./proc/2865
0G ./proc/2878
0G ./proc/2984
0G ./proc/3059
0G ./proc/3447
0G ./proc/3574
0G ./proc/3577
0G ./proc/3580
0G ./proc/3607
0G ./proc/3718
0G ./proc/3794
0G ./proc/3822
0G ./proc/3848
0G ./proc/3856
0G ./proc/3868
0G ./proc/3913
0G ./proc/3961
0G ./proc/3996
0G ./proc/3997
0G ./proc/4003
0G ./proc/4005
0G ./proc/4008
0G ./proc/4009
0G ./proc/4074
0G ./proc/4195
0G ./proc/4221
0G ./proc/4288
0G ./proc/4351
0G ./proc/4404
0G ./proc/4435
0G ./proc/4501
0G ./proc/5146
0G ./proc/5283
0G ./proc/5383
0G ./proc/5449
0G ./proc/5569
0G ./proc/5720
0G ./proc/5746
0G ./proc/5887
0G ./proc/6030
0G ./proc/6544
0G ./proc/6561
0G ./proc/6562
0G ./proc/6564
0G ./proc/6572
0G ./proc/6576
0G ./proc/6598
0G ./proc/6618
0G ./proc/6633
0G ./proc/6658
0G ./proc/6724
0G ./proc/6893
0G ./proc/6895
0G ./proc/6898
0G ./proc/6903
0G ./proc/6929
0G ./proc/6955
0G ./proc/6957
du: 无法访问"./proc/6978/task/6978/fd/4": 没有那个文件或目录
du: 无法访问"./proc/6978/task/6978/fdinfo/4": 没有那个文件或目录
du: 无法访问"./proc/6978/fd/4": 没有那个文件或目录
du: 无法访问"./proc/6978/fdinfo/4": 没有那个文件或目录
0G ./proc/6978
0G ./proc/7072
0G ./proc/7083
0G ./proc/9570
0G ./proc/9625
0G ./proc/9628
0G ./proc/9634
0G ./proc/9643
0G ./proc/9645
0G ./proc/9649
0G ./proc/10194
0G ./proc/10195
0G ./proc/10201
0G ./proc/10204
0G ./proc/10207
0G ./proc/10208
0G ./proc/10211
0G ./proc/10705
0G ./proc/11590
0G ./proc/11611
0G ./proc/11979
0G ./proc/12184
0G ./proc/12629
0G ./proc/12754
0G ./proc/13119
0G ./proc/13542
0G ./proc/13815
0G ./proc/14005
0G ./proc/14009
0G ./proc/14014
0G ./proc/14319
0G ./proc/14607
0G ./proc/14613
0G ./proc/14909
0G ./proc/16290
0G ./proc/16296
0G ./proc/16300
0G ./proc/16400
0G ./proc/16519
0G ./proc/16541
0G ./proc/16544
0G ./proc/16548
0G ./proc/16550
0G ./proc/16908
0G ./proc/16957
0G ./proc/16997
0G ./proc/17048
0G ./proc/17049
0G ./proc/17165
0G ./proc/18302
0G ./proc/18340
0G ./proc/18535
0G ./proc/18783
0G ./proc/18903
0G ./proc/19638
0G ./proc/19704
0G ./proc/20152
0G ./proc/20480
0G ./proc/20891
0G ./proc/20893
0G ./proc/20896
0G ./proc/20969
0G ./proc/21076
0G ./proc/21185
0G ./proc/21207
0G ./proc/21229
0G ./proc/21405
0G ./proc/21406
0G ./proc/21411
0G ./proc/21415
0G ./proc/21421
0G ./proc/21423
0G ./proc/21713
0G ./proc/21714
0G ./proc/21717
0G ./proc/21780
0G ./proc/22217
0G ./proc/22220
0G ./proc/22227
0G ./proc/22906
0G ./proc/23198
0G ./proc/23778
0G ./proc/24389
0G ./proc/24873
0G ./proc/24889
0G ./proc/25517
0G ./proc/25704
0G ./proc/25761
0G ./proc/25873
0G ./proc/26094
0G ./proc/26512
0G ./proc/26619
0G ./proc/26753
0G ./proc/27239
0G ./proc/27390
0G ./proc/28009
0G ./proc/28099
0G ./proc/28229
0G ./proc/28269
0G ./proc/28303
0G ./proc/28305
0G ./proc/28308
0G ./proc/28636
0G ./proc/28642
0G ./proc/28647
0G ./proc/28717
0G ./proc/28847
0G ./proc/29032
0G ./proc/29039
0G ./proc/29437
0G ./proc/29501
0G ./proc/30340
0G ./proc/31236
0G ./proc/31274
0G ./proc/31301
0G ./proc/31430
0G ./proc/31473
0G ./proc/31534
0G ./proc/32182
0G ./proc/32315
0G ./proc
0G ./run/NetworkManager
0G ./run/dbus
0G ./run/sepermit
0G ./run/tuned
0G ./run/ppp
0G ./run/setrans
0G ./run/openldap
0G ./run/faillock
0G ./run/nscd
0G ./run/user
0G ./run/netreport
0G ./run/nslcd
0G ./run/iptraf-ng
0G ./run/console
0G ./run/lvm
0G ./run/plymouth
1G ./run/tmpfiles.d
1G ./run/udev
0G ./run/mount
1G ./run/log
0G ./run/lock
1G ./run/initramfs
1G ./run/systemd
1G ./run
0G ./sys/fs
0G ./sys/bus
0G ./sys/dev
0G ./sys/devices
0G ./sys/block
0G ./sys/class
0G ./sys/power
0G ./sys/firmware
0G ./sys/kernel
0G ./sys/module
0G ./sys/hypervisor
0G ./sys
1G ./etc/pki
1G ./etc/rpm
1G ./etc/yum.repos.d
1G ./etc/yum
1G ./etc/lvm
1G ./etc/depmod.d
0G ./etc/dracut.conf.d
1G ./etc/audit
1G ./etc/rdma
0G ./etc/gnupg
1G ./etc/modprobe.d
0G ./etc/binfmt.d
0G ./etc/modules-load.d
1G ./etc/systemd
0G ./etc/sysctl.d
1G ./etc/rsyslog.d
1G ./etc/udev
1G ./etc/ppp
1G ./etc/fonts
1G ./etc/java
1G ./etc/profile.d
0G ./etc/rwtab.d
0G ./etc/statetab.d
0G ./etc/cron.weekly
1G ./etc/X11
1G ./etc/bash_completion.d
0G ./etc/opt
0G ./etc/pm
1G ./etc/skel
1G ./etc/sysconfig
0G ./etc/xdg
0G ./etc/xinetd.d
0G ./etc/terminfo
1G ./etc/prelink.conf.d
1G ./etc/default
1G ./etc/cron.d
1G ./etc/ld.so.conf.d
1G ./etc/cron.hourly
1G ./etc/NetworkManager
1G ./etc/firewalld
1G ./etc/dbus-1
0G ./etc/jvm
0G ./etc/popt.d
1G ./etc/alternatives
0G ./etc/chkconfig.d
1G ./etc/rc.d
0G ./etc/cron.monthly
1G ./etc/polkit-1
1G ./etc/grub.d
1G ./etc/wpa_supplicant
0G ./etc/dnsmasq.d
0G ./etc/gcrypt
1G ./etc/libnl
0G ./etc/pkcs11
1G ./etc/plymouth
1G ./etc/sasl2
1G ./etc/groff
1G ./etc/audisp
1G ./etc/selinux
0G ./etc/gss
1G ./etc/ssh
0G ./etc/dhcp
0G ./etc/maven
0G ./etc/ssl
1G ./etc/tmpfiles.d
1G ./etc/python
1G ./etc/pam.d
1G ./etc/security
1G ./etc/iproute2
1G ./etc/ant.d
1G ./etc/avahi
1G ./etc/cron.daily
1G ./etc/logrotate.d
1G ./etc/my.cnf.d
1G ./etc/openldap
1G ./etc/tuned
1G ./etc/ntp
1G ./etc/postfix
1G ./etc/kernel
0G ./etc/sudoers.d
0G ./etc/krb5.conf.d
0G ./etc/jvm-commmon
0G ./etc/gdbinit.d
1G ./etc/mail
0G ./etc/smrsh
1G ./etc
2G ./root/tools
1G ./root/.oracle_jre_usage
1G ./root/.cache
0G ./root/.conda
1G ./root/.local
1G ./root/.sbt
1G ./root/bin
1G ./root/.qws
0G ./root/.config
1G ./root/.ssh
1G ./root/.astropy
0G ./root/mv
1G ./root/.ipython
1G ./root/.ivy2
3G ./root/anaconda3
1G ./root/.pycharm_helpers
0G ./root/.pki
1G ./root/.m2
10G ./root
0G ./tmp/.font-unix
0G ./tmp/.ICE-unix
0G ./tmp/.Test-unix
0G ./tmp/.XIM-unix
0G ./tmp/.X11-unix
0G ./tmp/hsperfdata_hadoop
1G ./tmp/hsperfdata_root
0G ./tmp/Jetty_0_0_0_0_50070_hdfs____w2cu08_8854997322937407694
0G ./tmp/Jetty_0_0_0_0_50070_hdfs____w2cu08_413782304536331551
0G ./tmp/Jetty_0_0_0_0_50070_hdfs____w2cu08_4739400385710611595
0G ./tmp/Jetty_hadoop1_50090_secondary____.t2t9am
0G ./tmp/pip-g3p023g9-unpack
0G ./tmp/Jetty_0_0_0_0_50070_hdfs____w2cu08_75127038679212854
0G ./tmp/67d78a64-71a2-4be6-8d23-8dc78e695fd1_resources
0G ./tmp/pip-2q53_ygg-unpack
0G ./tmp/pip-2uyf0lub-unpack
0G ./tmp/pip-p3wyxxgh-unpack
0G ./tmp/pip-uae91eic-unpack
0G ./tmp/Jetty_0_0_0_0_50070_hdfs____w2cu08_7649631246077409088
0G ./tmp/Jetty_0_0_0_0_50070_hdfs____w2cu08_1616998678285400436
0G ./tmp/Jetty_0_0_0_0_50075_datanode____hwtdwq
0G ./tmp/pip-bydhir9x-unpack
0G ./tmp/pip-gjflfwpj-unpack
0G ./tmp/pip-d04ufvwy-unpack
0G ./tmp/hadoop
0G ./tmp/583c286b-d1db-4923-9026-d22a2fc7c6ca_resources
0G ./tmp/abb35a41-ca0c-492d-a8a5-6d1f65659883_resources
0G ./tmp/c14ba481-8920-464a-9f9a-a8a19d3f8f38_resources
0G ./tmp/2140fa25-cf44-4ca0-b007-80c5c0446474_resources
0G ./tmp/b5420b0d-174c-43bc-9e46-8dd9eddaa11d_resources
0G ./tmp/scala-develhadoop
0G ./tmp/Jetty_hadoop1_50090_secondary____.t2t9am_1829256356024612319
1G ./tmp/pip-_hz_5gh0-unpack
1G ./tmp/pip-hcbr693u-unpack
1G ./tmp/pip-iug1xzfc-unpack
0G ./tmp/Jetty_0_0_0_0_50075_datanode____hwtdwq_1368890986186795539
0G ./tmp/Jetty_hadoop1_50090_secondary____.t2t9am_6376675854341615138
0G ./tmp/Jetty_0_0_0_0_50075_datanode____hwtdwq_8459498440975771758
0G ./tmp/Jetty_hadoop1_50090_secondary____.t2t9am_3647884605897976165
0G ./tmp/Jetty_0_0_0_0_50070_hdfs____w2cu08
0G ./tmp/Jetty_0_0_0_0_50070_hdfs____w2cu08_3140729051062663585
0G ./tmp/Jetty_hadoop1_50090_secondary____.t2t9am_4986171479208438516
0G ./tmp/Jetty_0_0_0_0_50075_datanode____hwtdwq_2092284936592684225
0G ./tmp/Jetty_0_0_0_0_50070_hdfs____w2cu08_9008427800105805452
0G ./tmp/Jetty_0_0_0_0_50075_datanode____hwtdwq_4534715308826349404
0G ./tmp/Jetty_hadoop1_50090_secondary____.t2t9am_3440839642485507553
0G ./tmp/Jetty_0_0_0_0_50070_hdfs____w2cu08_4954559430973524569
0G ./tmp/Jetty_0_0_0_0_50075_datanode____hwtdwq_2652299865454137536
0G ./tmp/Jetty_hadoop1_50090_secondary____.t2t9am_521332338392228276
0G ./tmp/Jetty_0_0_0_0_50075_datanode____hwtdwq_7916531522333623402
0G ./tmp/Jetty_hadoop1_8088_cluster____.jtly5k
0G ./tmp/Jetty_0_0_0_0_8042_node____19tj0x
1G ./tmp
1G ./var/lib
1G ./var/log
0G ./var/adm
1G ./var/cache
1G ./var/db
0G ./var/empty
0G ./var/games
0G ./var/gopher
0G ./var/local
0G ./var/nis
0G ./var/opt
0G ./var/preserve
1G ./var/spool
1G ./var/tmp
0G ./var/yp
0G ./var/kerberos
0G ./var/crash
1G ./var
1G ./usr/bin
1G ./usr/sbin
2G ./usr/lib
1G ./usr/lib64
1G ./usr/share
0G ./usr/etc
0G ./usr/games
1G ./usr/include
1G ./usr/libexec
8G ./usr/local
0G ./usr/src
1G ./usr/hppa64-linux-gnu
1G ./usr/s390x-linux-gnu
1G ./usr/m68k-linux-gnu
1G ./usr/powerpc64-linux-gnu
1G ./usr/h8300-elf
0G ./usr/h8300-linux-gnu
1G ./usr/sh-linux-gnu
1G ./usr/ia64-linux-gnu
0G ./usr/c6x-linux-gnu
1G ./usr/c6x-uclinux
1G ./usr/sparc64-linux-gnu
1G ./usr/aarch64-linux-gnu
1G ./usr/alpha-linux-gnu
1G ./usr/sh64-linux-elf
0G ./usr/sh64-linux-gnu
0G ./usr/tile-linux-gnu
1G ./usr/tilegx-linux
1G ./usr/avr-linux
0G ./usr/avr32-linux-gnu
1G ./usr/frv-linux-gnu
1G ./usr/x86_64-linux-gnu
0G ./usr/arm-linux-gnu
1G ./usr/arm-linux-gnueabi
0G ./usr/bfin-linux-gnu
1G ./usr/bfin-uclinux
1G ./usr/mips64-linux-gnu
1G ./usr/cris-linux-gnu
1G ./usr/microblaze-linux-gnu
1G ./usr/am33_2.0-linux
0G ./usr/mn10300-linux-gnu
1G ./usr/hppa-linux-gnu
1G ./usr/xtensa-linux-gnu
1G ./usr/m32r-elf
0G ./usr/m32r-linux-gnu
1G ./usr/lcoal
11G ./usr
0G ./media
1G ./mnt/mongodb_data_bak
5G ./mnt/mongodb_data
5G ./mnt
0G ./opt
0G ./srv
2G ./data/db1
1G ./data/db
2G ./data
0G ./data0/logs
0G ./data0
89G .
[root@hadoop1 /]#

[root@hadoop1 /]# du -BG  -s
du: 无法访问"./proc/7100/task/7100/fd/4": 没有那个文件或目录
du: 无法访问"./proc/7100/task/7100/fdinfo/4": 没有那个文件或目录
du: 无法访问"./proc/7100/fd/4": 没有那个文件或目录
du: 无法访问"./proc/7100/fdinfo/4": 没有那个文件或目录
89G .
您在 /var/spool/mail/root 中有新邮件
[root@hadoop1 /]#

root@hadoop1 /]# du --help
用法:du [选项]... [文件]...
 或:du [选项]... --files0-from=F
Summarize disk usage of each FILE, recursively for directories.

Mandatory arguments to long options are mandatory for short options too.
  -0, --null            end each output line with 0 byte rather than newline
  -a, --all             write counts for all files, not just directories
      --apparent-size   print apparent sizes, rather than disk usage; although
                          the apparent size is usually smaller, it may be
                          larger due to holes in ('sparse') files, internal
                          fragmentation, indirect blocks, and the like
  -B, --block-size=SIZE  scale sizes by SIZE before printing them; e.g.,
                           '-BM' prints sizes in units of 1,048,576 bytes;
                           see SIZE format below
  -b, --bytes           equivalent to '--apparent-size --block-size=1'
  -c, --total           produce a grand total
  -D, --dereference-args  dereference only symlinks that are listed on the
                          command line
  -d, --max-depth=N     print the total for a directory (or file, with --all)
                          only if it is N or fewer levels below the command
                          line argument;  --max-depth=0 is the same as
                          --summarize
      --files0-from=F   summarize disk usage of the
                          NUL-terminated file names specified in file F;
                          if F is -, then read names from standard input
  -H                    equivalent to --dereference-args (-D)
  -h, --human-readable  print sizes in human readable format (e.g., 1K 234M 2G)
      --inodes          list inode usage information instead of block usage
  -k                    like --block-size=1K
  -L, --dereference     dereference all symbolic links
  -l, --count-links     count sizes many times if hard linked
  -m                    like --block-size=1M
  -P, --no-dereference  don't follow any symbolic links (this is the default)
  -S, --separate-dirs   for directories do not include size of subdirectories
      --si              like -h, but use powers of 1000 not 1024
  -s, --summarize       display only a total for each argument
  -t, --threshold=SIZE  exclude entries smaller than SIZE if positive,
                          or entries greater than SIZE if negative
      --time            show time of the last modification of any file in the
                          directory, or any of its subdirectories
      --time=WORD       show time as WORD instead of modification time:
                          atime, access, use, ctime or status
      --time-style=STYLE  show times using STYLE, which can be:
                            full-iso, long-iso, iso, or +FORMAT;
                            FORMAT is interpreted like in 'date'
  -X, --exclude-from=FILE  exclude files that match any pattern in FILE
      --exclude=PATTERN    exclude files that match PATTERN
  -x, --one-file-system    skip directories on different file systems
      --help  显示此帮助信息并退出
      --version  显示版本信息并退出

所显示的数值是来自 --block-size、DU_BLOCK_SIZE、BLOCK_SIZE
及 BLOCKSIZE 环境变量中第一个可用的 SIZE 单位。
否则,默认单位是 1024 字节(或是 512,若设定 POSIXLY_CORRECT 的话)。

SIZE is an integer and optional unit (example: 10M is 10*1024*1024).  Units
are K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB, ... (powers of 1000).

GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
请向<http://translationproject.org/team/zh_CN.html> 报告du 的翻译错误
要获取完整文档,请运行:info coreutils 'du invocation'
[root@hadoop1 /]#

原文地址:https://www.cnblogs.com/rsapaper/p/8038123.html