Register now or log in to join your professional community.
The ‘df‘ command stand for “disk filesystem“, it is used to get full summary of available and used disk space usage of file system on Linux system.
The du (disk usage) command reports the sizes of directory trees inclusive of all of their contents and the sizes of individual files
df -h shows you the details of the used / available space in each mounted partition.
du -a shows you the size of the files in the directory which the command was executed.
#df means diks free and #du disk usage (this is not the size allocated by the system for the file system)
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 is 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?"
DF: Report how much free disk space is available for each mount you have.DU: used to estimate file space usage—space used under a particular directory or files on a file system.
Simply df will show you disk free and du will show you disk usage
$ df -k
Filesystem1024-blocks Free %Used Iused %Iused Mounted on
/dev/hd4 32768 16016 52% 2271 14% /
/dev/hd2 4587520 1889420 59% 37791 4% /usr
/dev/hd9var65536 12032 82% 518 4% /var
/dev/hd3 819200 637832 23% 1829 1% /tmp
/dev/hd1 524288 395848 25% 421 1% /home
/proc - - - - - /proc
/dev/hd10opt65536 26004 61% 654 4% /opt
$ du -sk *
152304 directoryOne
1856548 directoryTwo
df displays the free disk statistics while the du switch shows the different output like disk usage statistics