Centos下 du命令的使用,查看某个文件或目录占用磁盘空间的大小
一、du命令介绍
du
reports the amount of disk space used by the specified files and for each subdirectory (of directory arguments). with no arguments,du
reports the disk space for the current directory。
du命令用来查看目录或文件所占用磁盘空间的大小。常用选项组合为:du -sh
du 意思是 disk usage
二、du常用的选项
[root@localhost ftp_data]# 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.,