df -h -k understanding output du

Many people have asked me how to understand the output of df command.
For all of them i suggest strongly one thing try to use df command as like below first
df -h
tvt2086:/products/WAS64ZLX # df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/dasda1           4.2G  3.8G  347M  92% /
udev                   1001M  140K 1001M   1% /dev
/dev/dasdf1           1.3G   14M  1.2G   2% /tools
                            2.0G   33M  2.0G   2% /home
                            6.2G   79M  6.1G   2% /products
                            1.0G   33M  992M   4% /tmp

Basically df -h will gives the output in human readable form (-h)
So I will try to explain each column
column 1 : Filesystem
It basically tells how many disk drives are connected and available to the user.In the above case there are 6 drives connected. and they mapped to different folders. Ex : /dev/mapper/pvols-lhome is mounted to directory /home

Column 2 : Size
This basically tells how much capacity the disk is having. Say /dev/mapper/pvols-lhome is mounted to directory /home is of 2 GB capacity

Column 3 : Used
Simple it tells how much is used from the available

Column 4 : Avail
It tells how much is free presently, which is available space

Column 5: Use%
Used disk space in terms of %

Column 6 : Mounted on
This the directory on which the disk is mounted and through which we can use the space available.

we can use df -k Which gives the output in KB format.
Go to any of ur desired location and run the command "df -h ." or "df -k ."
tvt2086:/opt/DCD_Installers # df -h .
Filesystem            Size  Used Avail Use% Mounted on
/dev/dasda1           4.2G  3.9G  308M  93% /

So it tells the disk details from which current directory is taking space.

"du -sh ." tell the space that was being occupied by current directory.
tvt2086:/opt/DCD_Installers # du -sh .
472M    .
In the above example the directory named "DCD_Installers" is occupying around 472 MB on the disk space.

0 comments to "df -h -k understanding output du"

Post a Comment

Whoever writes Inappropriate/Vulgar comments to context, generally want to be anonymous …So I hope U r not the one like that?
For lazy logs, u can at least use Name/URL option which doesn’t even require any sign-in, The good thing is that it can accept your lovely nick name also and the URL is not mandatory too.
Thanks for your patience
~Krishna(I love "Transparency")

Popular Posts

Enter your email address:

Buffs ...


Powered by WidgetsForFree