Linux command-du view disk space usage

Source: Internet
Author: User

Format

Df-h Viewing disk partitions

The DU/ETC directory file size is listed in units that are k the last line is the sum

Du-m Unit is m less than 1m write 1m

Du-h Unit humanized Display k/m

DU-SH/ETC viewing the Pointing directory/file size

//////////////////////////////////////////////////////////////////////////////////////

Du view and LS view differences

[Email protected] ~]# Du-sh/etc/init.d/iptables
12k/etc/init.d/iptables
[Email protected] ~]# Ls-lh/etc/init.d/iptables
-rwxr-xr-x. 1 root root 11K July 10:08/etc/init.d/iptables///////du-12k ls-11k

Convert to K units

[Email protected] ~]# Ls-lb/etc/init.d/iptables
-rwxr-xr-x. 1 root root 11048 July 10:08/etc/init.d/iptables
[Email protected] ~]# Du-sb/etc/init.d/iptables
11048/etc/init.d/iptables////////ls-11048b du-11048b the same.

////////////////////////////////////////////////////////////////////////////////////////////////////

[Email protected] ~]# Touch/tmp/1.txt
[Email protected] ~]# echo ">>/tmp/1.txt"
[Email protected] ~]# Ll/tmp/1.txt
-rw-r--r--. 1 root root 3 November 6 19:35/tmp/1.txt/////true Size
[Email protected] ~]# Du-sh/tmp/1.txt
4.0k/tmp/1.txt/////takes up the size of the disk block

Linux command-du view disk space usage

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.