Linux commands: DU,DF usage notes

Source: Internet
Author: User
Tags readable disk usage

du Introduction to Commands:

Calculate the disk usage for each file, and the directory will take the total amount.

1 . Command format:

Usage: du [options] ... [File] ...

Or: du [options] ...--files0-from=f

2 . Command function:

Calculate the disk usage for each file, and the directory will take the total amount.

3 . Command parameters:

-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, but sometimes it gets bigger because of the "hole" between sparse files, internal fragments, blocks that are not directly referenced, and so on.

-B,--block-size= size block with specified number of bytes

-B, --bytes equals--apparent-size--block-size=1

-C, --total display total information

-S, --separate-dirs does not include sub-directory occupancy

-S, --summarize only calculates the total amount of each parameter in the command column separately

-X, --one-file-system skips directories on different file systems

-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 line break

4 . Command instance:

1, calculate the file size in/etc directory

[Email protected] test]# du-sh/etc

28M/etc

[Email protected] test]# du-s/etc

27820/etc

[Email protected] test]# du-h/etc

12K/ETC/POLKIT-1/LOCALAUTHORITY.CONF.D

8.0K/ETC/POLKIT-1/NULLBACKEND.CONF.D

4.0K/ETC/POLKIT-1/LOCALAUTHORITY/30-SITE.D

4.0K/ETC/POLKIT-1/LOCALAUTHORITY/50-LOCAL.D

4.0K/etc/polkit-1/localauthority/90-mandatory.d

4.0K/ETC/POLKIT-1/LOCALAUTHORITY/20-ORG.D

Introduction to DF Command:

Displays information about the file system where each file resides, by default displaying all file systems.

1 . Command format:

DF [Options] ... [File] ...

DF [option] ... [File]

2 . Command function:

displays information about the file system where each file resides, by default displaying all file systems .

3 . Command parameters:

-A,--all include dummy file systems

-B,--block-size=size use size-byte blocks

-H,--human-readable print sizes in human readable format (e.g., 1K 234M 2G)

-I, --inodes displays inode information instead of block usage

- K is--block-size=1k

-L, --local only displays the native file system

--no-sync do not synchronize before obtaining usage data (default)

-P, --portability using POSIX-compatible output formats

--sync Synchronous action before obtaining usage data

-T,--type= type only displays information for the specified file system for the specified type

-T, --print-type display file system type

4 . Command instance:

1, display the entire partition size and distribution of the hard disk

[Email protected] test]# df-h

Filesystem Size used Avail use% mounted on

/dev/sda2 4.9G 476M 4.1G 11%/

Tmpfs 947M 0 947M 0%/dev/shm

/DEV/SDA1 2.0G 61M 1.8G 4%/boot

/dev/sda3 3.9G 73M 3.6G 2%/Home

/dev/sda7 2.0G 35M 1.8G 2%/tmp

/dev/sda5 2.9G 1.7G 1.2G 59%/usr


This article is from the "Learn Linux history" blog, please be sure to keep this source http://woyaoxuelinux.blog.51cto.com/5663865/1866797

Linux commands: DU,DF usage notes

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.