Does df count hard links?
Hardlinks are real references to the same file (represented by its inode). There is no difference between the “original” file and a hard link pointing to it as well. It simply counts all the files’ sizes and sums them up. Only hardlinks within the considered directory are not counted more than once.
How many hard links does a file have?
Windows with NTFS filesystem has a limit of 1024 hard links on a file.
What does df do in Linux?
The df command (short for disk free), is used to display information related to file systems about total space and available space. If no file name is given, it displays the space available on all currently mounted file systems.
Why are Ls and du different sizes?
The du command shows how much disk space is used for the given file. In contrast, the ls command shows the size of the file. The space used can be larger than the file size, depending on the filesystem used. So the used disk space was in this example 4 kilobytes, although the filesize is only one byte.
Why is there a huge difference between DF and du?
That difference is almost always due to a huge deleted file still held open by some process, often a big log file. You can run (as root) and scroll down looking for something huge. If you have rebooted and still see the problem, then “fsck -f” on the filesystem is warranted.
What’s the difference between DF and du manpage?
Those two tools were meant for different propose. While df is to show the file system usage, du is to report the file space usage. du works from files while df works at filesystem level, reporting what the kernel says it has available. Continue reading the du manpage support this:
Why do ” DF ” and ” du ” commands show different disk usage?
While df is to show the file system usage, du is to report the file space usage. du works from files while df works at filesystem level, reporting what the kernel says it has available. Continue reading the du manpage support this: Summarize disk usage of each FILE, recursively for directories. it says du works with files.
How to get the output from Du to match that from DF?
To get the output from du to match that from df, we must add in the meta data. First, convert 41 4K blocks to 512-byte units: So there are 344 512-byte blocks allocated on this empty file system. For example: This value does match the output from the free column reported by df /foo. This calculation was easy to perform on an empty file system.