Linux Statistics folder footprint size--DU command basic usage

Source: Internet
Author: User

command-line environment to know the Linux system in a folder and its containing the actual amount of space occupied by the file, the Linux command du can be very good to meet the requirements.

I do not write all of the other uses, I think it will use the most, directly on:

$ du -sh . /* 118M.    /chemi4.0k    ./collectionframework32m.    /C Programming version fourth. Rectification. Scan version pdf7.7m    ./jsfppt360m.    / mooc34m    ./mvnt1.4g.    /reference251m    ./Compression Pack 20K    ./interview. ODT

The first column of output is the volume occupied by the file or folder, and the right side is the folder

Here are the options:

-S is to calculate the total space occupied by each directory, and no words will recursively list a lot of useless information;

-H very good understanding, is to choose the right unit, above some with M, some with G, so it is clear, here du's usage is this, detailed other options can refer to the man page.

The wildcard character is used in the parameter to list all files or folders in the current directory, otherwise only the total size of the current directory is listed.

--------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------

In addition, you may also think of the LS command, the general usage is this:

$LS-Alhtotal2.0MDrwxr-xr-xPrompt prompt4.0K December213:44. drwxr-xr-x6 root root4.0K July2316:29.. DRWX------3 Prompt prompt4.0K August1910:25. adobedrwxrwxr-x3 Prompt prompt4.0K July2315:07. amd-rw-rw-r--1 prompt prompt140 August610:58. appletviewer-rw-rw-r--1 prompt prompt86 August1722:10. ASOUNDRC-RW-------1 Prompt prompt 17K December122:59. bash_history-rw-r--r--1 prompt prompt220 July2314:16. bash_logout-rw-r--r--1 prompt prompt3.9K August21st22:14. bashrcdrwx------Prompt prompt4.0K December115:17. cachedrwx------3 Prompt prompt4.0K July2315:12. compizdrwx------Prompt prompt4.0K December115:17. configdrwx------3 Prompt prompt4.0K July2315:25. dbusdrwxr-xr-x2 prompt prompt4.0k December 1 15:03 desktop-rw-r--r--1 prompt prompt 25 July 23 15:12 dmrcdrwxrwxr-x 9 prompt prompt 4.0k December 2  14: 43 documentsdrwxrwxr-x 7 Prompt prompt 4.0k December 1  21: 00 Downloads            

Here LS is the option of everyone should know (-a display all files and folders, including the beginning of the;-l lists details such as the size of the occupied space, the user and so on;-H displays the amount of space in the appropriate units, such as using M or g), The size of the file is 4.0K, obviously it contains more than the file.

Linux Statistics folder footprint size--DU command basic 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.