"Go" linux command view file space size-DU,DF

Source: Internet
Author: User
Tags disk usage

Original URL: http://blog.csdn.net/wangjunjun2008/article/details/19840671

Du (disk usage), as the name implies, view the size of the directory/file footprint


#查看当前目录下的所有目录以及子目录的大小
$ du-h

$ du-ah

#-h: Using the human form of K, M and G to display

#-a: Displaying directories and files

DU-H tmp

Du-ah tmp
Size of #只查看当前目录下的tmp目录 (including subdirectories)


#查看当前目录及其指定深度目录的大小
Du-h–-max-depth=0
#-–max-depth=n: Drill down to the nth-level directory, set here to 0, which means not to go deep into subdirectories


Some common parameters of the du command:
-A or-all displays the size of individual files in the directory
-B or-bytes when displaying a directory or file size, in bytes
-C or--total displays the sum of all directories or files in addition to the size of individual directories or files
-D or--dereference-args displays the source file size for the specified symbolic connection
-H or--human-readable to improve readability of the information in K,M,G units
-K or--kilobytes in 1024x768 bytes units
-L or--count-links repeatedly compute hardware-attached files
The source file size of the symbol connection specified in the-L or--dereference display option
-M or--megabytes in 1MB units
-S or--summarize show totals only
-S or--separate-dirs displays the size of individual directories without the size of their subdirectories
-x< file > or--exclude-from=< file >
--exclude=< directory or File > skip the specified directory or file

--max-depth=< the directory layer > exceeds the specified number of layers, it is ignored

DF is used to view the space utilization of the device

$ df-lh

#查看设备使用率

"Go" linux command view file space size-DU,DF

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.