Linux operation and Maintenance system Engineer Series---24

Source: Internet
Author: User
Tags readable disk usage

Disk Management---View disk and directory size

Related commands:


DF: List file system disk usage


Du: Evaluate the disk usage of the filesystem (we often use it to view the directory size)

DF use: If no arguments are followed, then all mounted file system usage is viewed.


# DF
Filesystem 1k-blocks used Available use% mounted on
/dev/sda2 20642428 2747200 16846652 15%/
Tmpfs 515340 515260 1%/DEV/SHM
/DEV/SDA1 198337 27155 160942 15%/boot
/DEV/SDB2 202225 5902 185881 4%/sdb2
/DEV/SDB2 202225 5902 185881 4%/sdbuuid
/DEV/SDB2 202225 5902 185881 4%/sdblabel
/dev/sr0 3080782 3080782 0 100%/media/rhel_6.4 i386 Disc 1

-H: Displayed in a human-readable way


[Email protected] ~]# df-h
Filesystem Size used Avail use% mounted on
/dev/sda2 20G 2.7G 17G 15%/
Tmpfs 504M 80K 504M 1%/DEV/SHM
/DEV/SDA1 194M 27M 158M 15%/boot
/DEV/SDB2 198M 5.8M 182M 4%/sdb2
/DEV/SDB2 198M 5.8M 182M 4%/sdbuuid
/DEV/SDB2 198M 5.8M 182M 4%/sdblabel
/dev/sr0 3.0G 3.0G 0 100%/media/rhel_6.4 i386 Disc 1

-A: Show disk usage including virtual file system


[Email protected] ~]# df-a
Filesystem 1k-blocks used Available use% mounted on
/dev/sda2 20642428 2747232 16846620 15%/
Proc 0 0 0-/proc
Sysfs 0 0 0-/sys
Devpts 0 0 0-/dev/pts
Tmpfs 515340 515260 1%/DEV/SHM
/DEV/SDA1 198337 27155 160942 15%/boot
/DEV/SDB2 202225 5902 185881 4%/sdb2
/DEV/SDB2 202225 5902 185881 4%/sdbuuid
/DEV/SDB2 202225 5902 185881 4%/sdblabel
None 0 0 0-/proc/sys/fs/binfmt_misc
Vmware-vmblock 0 0 0-/var/run/vmblock-fuse
/dev/sr0 3080782 3080782 0 100%/media/rhel_6.4 i386 Disc 1
Gvfs-fuse-daemon 0 0 0-/ROOT/.GVFS

-T: type of print file system


[Email protected] ~]# df-th
Filesystem Type Size used Avail use% mounted on
/dev/sda2 ext4 20G 2.7G 17G 15%/
Tmpfs tmpfs 504M 80K 504M 1%/DEV/SHM
/DEV/SDA1 ext4 194M 27M 158M 15%/boot
/DEV/SDB2 ext4 198M 5.8M 182M 4%/sdb2
/DEV/SDB2 ext4 198M 5.8M 182M 4%/sdbuuid
/DEV/SDB2 ext4 198M 5.8M 182M 4%/sdblabel
/dev/sr0 iso9660 3.0G 3.0G 0 100%/media/rhel_6.4 i386 Disc 1

-I: Lists the usage of the I node, not the block

[Email protected] ~]# df-i
Filesystem inodes iused IFree iuse% mounted on
/dev/sda2 1310720 94061 1216659 8%/
TMPFS 128835 5 128830 1%/dev/shm
/DEV/SDA1 51200 51162 1%/boot
/DEV/SDB2 52416 52404 1%/sdb2
/DEV/SDB2 52416 52404 1%/sdbuuid
/DEV/SDB2 52416 52404 1%/sdblabel
/dev/sr0 0 0 0-/media/rhel_6.4 i386 Disc 1

Du command:


Du does not add parameters, the size of files and directories under the current path is listed by default


-S: Only the total size is listed


[Email protected] ~]# du-s/root/
43700/root/


-H: Displayed in a human-readable way


[Email protected] ~]# du-sh/root/
43m/root/

--max-depth: Specify the maximum depth


[email protected] ~]# du--max-depth=1-h/
Only the bottom level of the root path occupies space, which is commonly used to analyze that directory consumes more disk space

This article is from the "Empty Valley Orchid" blog, please be sure to keep this source http://2489843.blog.51cto.com/2479843/1672529

Linux operation and Maintenance system Engineer Series---24

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.