linux--Viewing disk space usage

Source: Internet
Author: User

1.

Linux View disk space size command

The Df-h DF command is a Linux system that views the file system as a disk partition, which can be added with parameters to view the disk's remaining space information, the command format: DF-HL display format: File system capacity is used available% mount point Filesystem Size used Avail U Se% mounted on/dev/hda2 45G 19G 24G 44%//dev/hda1 494

Df-h

The DF command is a Linux system that views the file system as a disk partition, which can be added with parameters to view the disk's remaining space information, command format:

Df-hl

The display format is:

File system capacity has been used with available% mount points

Filesystem Size used Avail use% mounted on

/dev/hda2 45G 19G 24G 44%/

/DEV/HDA1 494M 19M 450M 4%/boot

/dev/hda6 4.9G 2.2G 2.5G 47%/Home

/dev/hda5 9.7G 2.9G 6.4G 31%/opt

None 1009M 0 1009M 0%/dev/shm

/dev/hda3 9.7G 7.2G 2.1G 78%/usr/local

/DEV/HDB2 75G 75G 0 100%/

/DEV/HDB2 75G 75G 0 100%/

With the above output as an example, the meaning of the expression is:

The second hard drive interface (b), the second partition (2), the capacity is 75G, with 75G, usable is 0, so the utilization is 100%, is mounted to the root partition directory (/).

The following is an explanation of the relevant commands:

123456789 df -hl 查看磁盘剩余空间df -h 查看每个根路径的分区大小 du -sh [目录名] 返回该目录的大小 du -sm [文件夹] 返回该文件夹总M数du -h [目录名] 查看指定文件夹下的所有文件大小(包含子文件夹)

More functions you can enter the command to view:

DF--help

Du--help

2.

To view the partition of a hard disk #sudo fdisk-l

View IDE Hard disk information #sudo hdparm-i/dev/hda

View stat hard Drive information #sudo hdparm-i/DEV/SDA or #sudo apt-get install blktool #sudo BLKTOOL/DEV/SDA ID

View hard disk remaining space #df-H #df-H

View Directory footprint #du-HS directory name

The USB flash drive can't unload #sync fuser-km/media/usbdisk

linux--Viewing 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.