Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

du and df do rather similar things, and so I always find myself typing the wrong one.

I think if I knew what "du" and "df" stands for it might make it easier to remember which to use.

What is a way to differentiate between these two so I can remember which does which action?

share|improve this question
7  
Hah, Unix & Linux's tag autofill has already partially answered my question! Way to go! (I had tagged the question du, and after submission it autofilled it to disk-usage) –  Cory Klein Jun 28 '12 at 16:00
2  
Nice, stackexchange win! –  Tim Jun 28 '12 at 17:20
1  
For what it's worth, df looks at the file system, so I always mapped df with f with that –  user606723 Jun 28 '12 at 20:34
add comment

1 Answer

up vote 28 down vote accepted

du == Disk Usage. It walks through directory tree and counts the sum size of all files therein. It may not output exact information due to the possibility of unreadable files, hardlinks in directory tree, etc. It will show information about the specific directory requested. Think, "How much disk space is being used by these files?"

df == Disk Free. Looks at disk used blocks directly in filesystem metadata. Because of this it returns much faster that du but can only show info about the entire disk/partition. Think, "How much free disk space do I have?"

share|improve this answer
1  
Actually I would argue that du stands for "Directory Usage" (but yes, it is debatable :-P ) –  Patrick Jun 28 '12 at 22:27
5  
By the way even in the man page is written du - display disk usage statistics. –  rush Jun 29 '12 at 12:55
    
But is shows directory usage. Disk usage is what df does. So perhaps the man-page is the source of confusion here... –  Nils Jun 29 '12 at 19:23
4  
I was going to say that! +1 for beating me to it. I think "disk usage" is more appropriate than "directory usage" if you think of it as "disk usage for the files named as arguments." You can feed du(1) a long list of files, and it won't show any directory stats at all. –  Jan Steinman Jul 4 '12 at 17:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.