ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

What is the difference of df and du command?

user-image
تم إضافة السؤال من قبل Muhammad Anzar , DevOps/DevSecOps Architect , Confidential
تاريخ النشر: 2013/09/28
Muhammad Tahir Masood
من قبل Muhammad Tahir Masood , IT Project Manager (Infrastructure Support and IS Security) , Solution Founder Technology Company

 

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

 

Anil Mathew Kadakethu
من قبل Anil Mathew Kadakethu , Technical Support Manager , M H Alshaya

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.

 

Mohand ourabah BENABBAS
من قبل Mohand ourabah BENABBAS , Systems engineer , dimensiondata

 #df means diks free and  #du disk usage (this is not the size allocated by the system for the file system)  

Arunprakash kanagasabapathi
من قبل Arunprakash kanagasabapathi , Senior System Engineer , ITQAN

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?"

p sunitha
من قبل p sunitha

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.

Khandakar Ashfaqur Rahman
من قبل Khandakar Ashfaqur Rahman , Head Of Network , Smart Network Ltd

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

Rana Adnan Akram
من قبل Rana Adnan Akram , Security Specialist , Punjab Information Technology Board

df displays the free disk statistics while the du switch shows the different output like disk usage statistics

المزيد من الأسئلة المماثلة