Use Du to view the size of a file or directory that consumes disk space under Linux

Source: Internet
Author: User

Ubuntu View disk space Size command

The http://www.cnblogs.com/zhuiluoyu/p/6598928.html 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, 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

Current directory Size

Http://www.cnblogs.com/kobe8/p/3825461.html

Du-ah--max-depth=1

This is what I want. A means that all files and folders (without subdirectories) are displayed in the directory, and H represents the depth of the directory in a way that humans can understand, max-depth.

The explanations are as follows:

The du command is used to view the size of the disk space occupied by a directory or file. Common option combinations are: Du-sh

One, Du's function: ' Du ' reports the amount of disk space used by the specified files and for each subdirectory (of directory argument  s). With no arguments, ' du ' reports the disk space for the current directory.  Obviously, unlike DF, it is used to view the size of the disk space occupied by a file or directory. Second, du commonly used options:-H: In a human-readable way display-A: show the size of the disk space occupied by the directory, and also show the size of the disk space under its directory and file-s: Show the size of disk space occupied by the directory, do not show the size of the disk space used by the subdirectories and files- C: Displays the amount of disk space occupied by several directories or files, as well as the sum of their sums--apparent-size: Displays the size of the directory or file itself-L: Statistics hard links take up the size of disk space-L: The size of the file that the statistical symbolic link points to takes up the amount of disk space one, du-  H: That's not much to say. Du-a: When using this option, displays the directory and directory under which the subdirectories and files occupy the size of disk space.

Use Du to view the size of a file or directory that consumes disk space under Linux

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.