Linux View folder size, disk remaining space (DU/DF)

Source: Internet
Author: User
Tags readable disk usage

1. Introduction

Du view the directory size, DF to view disk usage.

2. Du

Disk usage
(1) Basic functions
Recursively view the size of all files under a folder
(2) Common parameters:
-h,–human-readable display dimensions in a more readable manner (e.g. 1K 234M 2G)
-s,–summarize only calculates the total amount of each parameter in the command column separately
(3) Other parameter description:
-a,–all the disk usage of all files, not just the directory
–apparent-size displays surface dosage, not disk usage, although surface dosage is usually smaller, sometimes it becomes larger due to "holes", internal fragments, non-directly referenced blocks between sparse files.
-b,–block-size= the size of a block using the specified number of bytes
-b,–bytes equals –apparent-size–block-size=1.
-c,–total Show Total Information
-d,–dereference-args to unblock symbolic connections listed on the command line
–files0-from=f the file name that ends with NUL in the computed files F corresponds to the disk space occupied if the value of F is "-", the file name is read from the standard input
-H equals –dereference-args (-D)
-h,–human-readable display dimensions in a more readable manner (e.g. 1K 234M 2G)
–si is similar to-H, but uses 1000 as the base instead of 1024 when calculating
-K equals –block-size=1k
-l,–count-links if it is a hard connection, calculate its dimensions multiple times
-M equals –block-size=1m
-l,–dereference Find out the true destination of any symbolic link indication
-p,–no-dereference does not follow any symbolic link (default)
-0,–null each blank line as 0 bytes instead of a line break
-s,–separate-dirs does not include the amount of sub-directories
-s,–summarize only calculates the total amount of each parameter in the command column separately
-x,–one-file-system skipping directories on different file systems
-x,–exclude-from= file excludes files that match the pattern described in the specified file
–exclude=pattern exclude files that match the patterns described in pattern
–max-depth=n Show catalog totals (use calculation files with –all)
When n is the specified value, the calculation depth is n;
–max-depth=0 equals –summarize.
–time Displays the last modified time for all files in the directory or subdirectory
–time=word Displays the WORD time, not the modified time: Atime,access,use,ctime or status
The –time-style= style displays the time in the specified style (the style interpretation rule is the same as the "date" command):
Full-iso,long-iso,iso,+format
Help display this help message and exit
–version display version information and exit

3. DF

DF-HL Viewing disk space remaining
Df-h viewing the partition size for each root path
Du-sh [directory Name] Returns the size of the directory
DU-SM [Folder] Returns the total number of M in this folder

4. Differences

Du is a file-oriented command that calculates only the space occupied by the file and does not calculate the space occupied by the file system metadata.
DF is calculated based on the overall file system, which determines the size of the allocated space in the system through unallocated space in the file system. The DF command can get how much space the hard disk occupies and how much space is left, and it can also show the usage of all file systems on the I node and disk blocks.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Linux View folder size, disk remaining space (DU/DF)

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.