The df and du commands for viewing the folder size in Linux are very practical.

Source: Internet
Author: User
The df and du commands for viewing the file and folder sizes in Linux are very practical, and the total number of folders is counted as: du-shxmldb/

View the size of the linux file directory and the number of files contained in the folder

Df allows you to view the size, usage ratio, file system, and its Mount point of a level-1 folder, but there is nothing to do with files.
Du allows you to view the file and folder size. When the disk size exceeds the standard, an alarm is triggered. it is wise to master the df and du commands.

Total statistics size


Du-sh xmldb/# count the size of the current directory and sort du-sm * | sort-ndu-sk * | grep guojf # check the second one/ pre-character text du-m | cut-d "/"-f 2 # view the number of files in the folder du xmldb/* | wc-l40752

Explanation: wc [-lmw] parameter description:-l: how many rows-m: How many characters-w: how many words


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.