理解linux的du用法

     du一般常用于查看某个目录下文件的大小

# du --help

Usage: du [OPTION]... [FILE]...

 or:  du [OPTION]...--files0-from=F

Summarize disk usage of each FILE, recursivelyfor directories.

 

Mandatory arguments to long options aremandatory for short options too.

  -a,--all             write counts for allfiles, not just directories

     --apparent-size   print apparentsizes, rather than disk usage; although

                          the apparent size isusually smaller, it may be

                          larger due to holesin (`sparse') files, internal

                          fragmentation,indirect blocks, and the like

  -B,--block-size=SIZE use SIZE-byte blocks

  -b,--bytes           equivalent to`--apparent-size --block-size=1'

  -c,--total           produce a grand total

  -D,--dereference-args  dereference FILEsthat are symbolic links

     --files0-from=F   summarize diskusage of the NUL-terminated file

                          names specified infile F

 -H                    like --si,but also evokes a warning; will soon

                          change to beequivalent to --dereference-args (-D)

  -h, --human-readable  print sizes in human readable format (e.g.,1K 234M 2G)

     --si              like -h, but usepowers of 1000 not 1024

  -k                    like --block-size=1K

  -l,--count-links     count sizes many timesif hard linked

 -m                    like--block-size=1M

  -L,--dereference     dereference allsymbolic links

  -P,--no-dereference  don't follow anysymbolic links (this is the default)

  -0,--null            end each output linewith 0 byte rather than newline

  -S,--separate-dirs   do not include size ofsubdirectories

  -s,--summarize       display only a totalfor each argument

  -x,--one-file-system  skip directories ondifferent file systems

  -XFILE, --exclude-from=FILE  Exclude filesthat match any pattern in FILE.

     --exclude=PATTERN Exclude files that match PATTERN.

     --max-depth=N     print the totalfor a directory (or file, with --all)

                          only if it is N orfewer levels below the command

                          line argument;  --max-depth=0 is the same as

                          --summarize

     --time            show time of thelast modification of any file in the

                          directory, or any ofits subdirectories

     --time=WORD       show time asWORD instead of modification time:

                          atime, access, use,ctime or status

     --time-style=STYLE show times using style STYLE:

                          full-iso, long-iso,iso, +FORMAT

 

一般常用du -sh来查看某个目录下文件的总大小

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值