View the remaining disk space and folder size in Linux

Source: Internet
Author: User

DF command is Linux The system views the file system by disk partition. You can add parameters to view the remaining disk space. Command Format:
DF-Hl
Display format:
File System capacity used available % mount point
Filesystem size used avail use % mounted on
/Dev/hda2 45g 19G 24g 44%/
/Dev/hda1 494 M 19 m 450 m 4%/boot
/Dev/hda6 4.9g 2.2g 2.5g 47%/home
/Dev/hda5 9.7g 2.9g 6.4g 31%/OPT
None 1009 M 0 1009 M 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%/

The preceding output is used as an example to indicate:
HD hard disk interface second hard disk (B), second partition (2), capacity is 75g, 75g used, available is 0, so the utilization is 100%, mounted to the root partition directory (/).

The following is an explanation of the relevant commands:

DF-Hl view the remaining disk space

DF-H: view the partition size of each root path

Du-SH [directory name] returns the directory size

Du-Sm [Folder] returns the total number of MB in this folder.

For more functions, run the following command:

DF -- Help

Du -- Help

View the size of the Linux File directory and the number of files contained in the folder

Total statistics size

Du-SH xmldb/

Du-Sm * | sort-N // count the current directory size and sort the directory size.

Du-SK * | sort-n

Du-SK * | grep guojf // view the size of a person

Du-M | cut-d "/"-F 2 // read the text before the second character

View the number of files in this folder /*

Du xmldb/

Du xmldb/* | WC-l

40752

Explanation:

WC [-LMW]

Parameter description:

-L: number of rows

-M: The number of characters.

-W: How many words

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.