Difference between du and df in CentOS
Centos users often ask why the results of using du and df to view disk capacity are inconsistent, whether there are bugs or disk fragments, or which result should prevail. In fact, the values obtained by the two commands are inconsistent because the implementation of the du command is different from that of the df command,
Du view the directory size, DF to view disk usage.I often use commands (sudo uses root privileges, if necessary),1. View the size of a directory: du-hs/home/master/documentsView the size of all directories under the directory and sort by size descending: sudo du-sm/etc/* | Sort-nr | Less2. View disk usage (file system usage): sudo df-hDF--BLOCK-SIZE=GB-H is to make the output easier for human reading; Du-s
The DF command is used to view the system's space and inode usage, and is also one of the common commands in System management and shipping dimension.
-a,–all displays all file systems, including local and mounted network file systems-b,–block-size=size Use custom block sizes, such as 1MB 2MB 1GB, etc. as units-h,–human-readable print sizes in human readable format (e.g., 1K 234M 2G) literal translation: Display in standard 1GB=1024MB size-h,–si Like
The following describes the basic Linux Command df and the du command parameters in linux. I hope this will be helpful for your learning. Df command parameters in linux: the df command parameters in linux are used to view the status information of the Linux File System and display the capacity, used, unused, and mount points of each partition. For example,
often, DF and du are used to view disk free space and space, and occasionally the DF (free space) is less than the disk size minus du (space occupied). two commands are implemented in the same way, but the process of implementation is fundamentally different. Just as two people go to the same place, but take different paths, so the length of the journey is different. the full name of the
When the size of the disk exceeds the standard, there will be alarm prompts, if you know the DF and du command is a very wise choice.DF can view the first-level folder size, usage scale, file system and its hang-in points, but there is nothing to file.Du can view the size of files and folders.It works well with both. For example, use DF to see which level of directory is too large, and then use
The content originates from the people's post and Telecommunications press "Linux command Application big dictionary"tell 729 commands, 1935 examplesLearn about the Linux system's reference books, desk book, encountered the command or command not understand the options can be foundStrive to publish content every dayDF commanduse the DF command to display information about the file system, which displays all file systems by default. Check the disk spac
A user logged on to the Linux system server to view the time, unexpectedly found that DF and du check out the results are not the same, du check out the "actual use of space" is significantly more than DF to check out the use of space is much smaller, this is how is it? Is there some space hidden away? Here's what df and Du commands have found to be different sol
One, memory unit conversion
byte byte meaning
b is a computer storage of the basic unit (byte);1 English characters are 1 bytes, i.e. 1B;1 Chinese characters are 2 characters, i.e. 2B;
1024b=1kb
1024kb=1mb
1024mb=1gb
1024GB=1TB
two, command DF
Command syntaxDF [Options] [parameters]
Command descriptionThe DF command displays the total capacity of the mounted disk, using capacity, remaining capacity, and
What is the difference between df and du commands in Linux? 1. df shows the usage of the file system. compared with du, df is more comprehensive. Df-T is the most commonly used
What is the difference between df and du commands in Linux?
1.
1, the difference between the twoDu,disk usage, is to calculate the size of each file by searching for files and then add up, du can see the files are just some currently exist, and it has not been deleted. The size of his calculations is the cumulative sum of all the file sizes that he currently thinks exist.Df,disk free, through the file system to quickly get information about the size of the space, when we delete a file, this file does notis immediately disappear in the file system, but tempo
DF displays a much larger percentage of the used disk occupancy than du statistics. The reason is mainly due to the different ways of calculating the results.
First, the experimental situation1. Create and delete filesDisk capacity before file creation:Reference # Df-hFile system capacity used available% mount point/DEV/SDA1 12G 5.7G 5.5G 51%/Tmpfs 506M 0 506M 0%/dev/shm
Create file: Reference # dd If=/dev/
This morning received a Netizen's help, saying that the root partition of the server is full. However, there is no specific large file to find. Because the fault is really weird, I will come to the relevant account password of the failed server.
Failed server related environments:
System: Centos 6.5
Selinux:disabled
Iptables: Open, but the default policy is all: ACCEPT
Our auxiliary server related environment:
System: Centos 6.5
Selinux:permissive
Iptables: Open, but the default policy is all:
DFCommand:Check disk space usage of the file system
Commonly used: DF-hi, DF,-ha, DF-th, DF-th-x vfat,
Function: You can use this command to obtain the space occupied by the hard disk and the remaining space.
Syntax: DF [Option]
-A: displays the disk usage of all file sy
Du and df in Linux
During Linux O M, it is often found that the values of du and df are different, and sometimes they are very different.
In specific circumstances, df may see that the disk is full, but du determines that the disk space is large.
The file system allocates some disk blocks to record some of its own data, such as I nodes, disk distribution char
DF command parameter function in Linux: Check the disk space consumption of the file system. You can use this command to get information about how much space the hard disk is taking up, and how much space is left.Syntax:DF [ options ] The various options for this command have the following meanings:-a displays disk usage for all file systems, including 0 blocks of file systems, such as the/proc file system.-H more Current disk space and usage to disp
Alarm when disk exceeds size#df View the first-level directory size, usage scale, file system mount point. The file size cannot be displayed. Statistics block usage.#du View the size of the file and the directory. Statistics file size added. If a hit file is opened, but the file is either RM or MV, but the process of opening the file is not closed, the Du value is updated, but the DF statistic is not update
App server root full, always alarmDF shows that the root partition has used 90% of the space, but the sum of the Du root partition is only about 40G, the partition should not have a large number of small files, so there should be no large number of small files caused by block write full problem.Online search issued by the existing may be a program to operate large files resulting in the file handle is not released, these programs are occupied by the file handle will be
Document directory
Du command:
DF command:
Unallocated space in the file system is used to determine the size of allocated space in the file system. For example, if a file system contains 8192 512-byte blocks and 4096 are not allocated, the allocated space is 4096-byte blocks.
Allocated space = total space-unallocated Space
Because the calculation is based on the overall file system, the DF command is
Du, df, and Linuxdudf in Linux
During Linux O M, it is often found that the values of du and df are different, and sometimes they are very different.
In specific circumstances, df may see that the disk is full, but du determines that the disk space is large.
The file system allocates some disk blocks to record some of its own data, such as I nodes, disk distr
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.