What is the difference between using the command du and df in Linux to find disk space?
-
-
Answer:
Intuitive Explanation: du implies http://en.wikipedia.org/wiki/Du_%28Unix%29. "How much disk space is being used by these files?" It walks through directory tree and counts the sum size of all files therein. df implies http://en.wikipedia.org/wiki/Df_%28Unix%29. "How much free disk space do I have?" Looks at disk used blocks directly in filesystem metadata. Because of this it can only show info about the entire disk/partition. However for a more thorough insight read http://linuxshellaccount.blogspot.in/2008/12/why-du-and-df-display-different-values.html
Sushant Hiray at Quora Visit the source
Other answers
This is the easiest method I have found to date to find large files!Here is a example if your root mount is full / (mount /root) Example:cd / (so you are in root)ls | xargs du -hsExample Output:9.4M bin63M boot4.0K cgroup680K dev31M etc6.3G home313M lib32M lib6416K lost+found61G media4.0K mnt113M optdu: cannot access `proc/6102/task/6102/fd/4': No such file or directory0 proc19M root840K run19M sbin4.0K selinux4.0K srv25G store26M tmpthen you would notice that store is large do a cd /storeand run againls | xargs du -hsExample output:109M backup358M fnb4.0G iso8.0K ks16K lost+found47M root11M scripts79M tmp21G vmsin this case the vms directory is the space hog.
Nikky
Related Q & A:
- What's the difference between Windows vs. Linux?Best solution by techrepublic.com
- Can I estimate the row count of a large mysql table using the disk space?Best solution by Database Administrators
- How to remove docker containers when out of disk space?Best solution by Stack Overflow
- What is the difference between ''Size" and "Size on Disk?Best solution by Yahoo! Answers
- Why do I keep running out of disk space?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.