Linux system view file and folder size for hard drive

Source: Internet
Author: User
Tags readable disk usage

1. DF can view the level of folder size, usage ratio, file system and its mount point, but not for the file (see only the windows of the similar C disk, D disk)
Du can view the size of files and folders, more useful

2. [Ia@i5a6 ~]$ Df-h

Parameter-H indicates the use of "human-readable" output, that is, in the file system size using GB, MB, and other readable format (compare the parameters used, compared to you do not count the number of bytes)

3. Du: Querying for file or folder disk usage space

Specifies the number of layers in the Drill-down directory, parameters: –max-depth=

[Ia@i5a6 ~]# du-h–max-depth=1/usr/local/webserver/

These two instructions can basically view the corresponding file occupancy and reach the cleanup information provided.

Du: Querying for file or folder disk use space

If you have a large number of files and folders in the current directory, you can iterate through the space used by all files and folders by using commands with no parameters du. This is a bad place to see if it's too big, so specify the number of layers in the Drill-down directory, Parameters:--max-depth=, which is a very useful parameter! For example, note that you can use "*" to get the size of the file space.

Reminder: It has always been ordered to be more complex than Linux, and its du command specifies that the number of layers in the Drill-down directory is simpler than Linux, FreeBSD.

The following is a code fragment:

[Root@bsso yayu]# du-h--max-depth=1 work/testing
27M Work/testing/logs
35M work/testing

[Root@bsso yayu]# du-h--max-depth=1 work/testing/*
8.0K work/testing/func.php
27M Work/testing/logs
8.1M Work/testing/nohup.out
8.0K work/testing/testing_c.php
12K work/testing/testing_func_reg.php
8.0K work/testing/testing_get.php
8.0K work/testing/testing_g.php
8.0K work/testing/var.php

[Root@bsso yayu]# du-h--max-depth=1 work/testing/logs/
27M work/testing/logs/

[Root@bsso yayu]# du-h--max-depth=1 work/testing/logs/*
24K Work/testing/logs/errdate.log_show.log
8.0K Work/testing/logs/pertime_show.log
27M Work/testing/logs/show.log

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.