1

df -h shows:

df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ada0p2    1.9G    256M    1.5G    14%    /
devfs          1.0K    1.0K      0B   100%    /dev
/dev/ada0p4    804G     34G    706G     5%    /usr
/dev/ada0p5     93G    3.5G     82G     4%    /var

but, du -sh shows:

du -sh /var
3.5G    /var

Why? df is telling me i have no space out of the 93G but when i check the file size of the /var/ directory it amounts to 3.5G?

Can any one explain why this is please?

Adamski
  • 113
  • 6
  • 3
    [Please don't post images of text](https://unix.meta.stackexchange.com/questions/4086/psa-please-dont-post-images-of-text) – cas Jul 23 '17 at 10:46
  • that does not answer my question! However I will note that rule next time! – Adamski Jul 23 '17 at 10:59
  • 2
    Don't confuse question comments with answers, and don't note the rule for next time. [Edit] and fix _this_ question _now_, please. – JdeBP Jul 23 '17 at 11:31
  • removed images and pasted output. – Adamski Jul 23 '17 at 12:15
  • Thank you. Have you spotted that `df` is no longer doing what you said? (-: You actually have a more interesting question that is _not quite_ a duplicate of the other question, because you had `df` showing you that _even the free space reserved for the superuser_ had been taken (not the case in the other questions), and then showing you that it had come back. – JdeBP Jul 23 '17 at 12:25

1 Answers1

0

First of all your question is very interesting in itself the df and du tools work differently in Linux

according to Linux man page

du - estimate file space usage

df - report file system disk space usage

df works on the file system level while du works on file level so if there are open file descriptors it will be reported by du but not df

varnit
  • 219
  • 1
  • 5