LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-04-2012, 12:41 PM   #1
anjumanu321
Member
 
Registered: May 2011
Location: Hyderabad, India
Distribution: RedHat 6,Centos,Debian Squeeze
Posts: 49

Rep: Reputation: Disabled
Difference between the commands 'df' and 'du'


hello all,

hope you are all doing good.

I tried these two commands: df and du
Both are giving different outputs.For example:

df -h gives the output as:
/dev/mapper/vg-lv1 42G(Size) 22G(Used) 18G(Avail) 56%(Use) /

whereas du -sh /root gives the output as:
6.0G /root

Why is it showing different sizes for the same partition and which of those commands is showing the exact size?

Thanks,
Anji
 
Old 07-04-2012, 12:44 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,133
Blog Entries: 2

Rep: Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836
Because your root partition is named / and not /root. You have asked du for the size of your root user's home directory.
 
Old 07-04-2012, 12:45 PM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,362

Rep: Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752
because those are two different partitions. Try mount, or df to find out your mounts (or partitions)
 
Old 07-04-2012, 01:39 PM   #4
anjumanu321
Member
 
Registered: May 2011
Location: Hyderabad, India
Distribution: RedHat 6,Centos,Debian Squeeze
Posts: 49

Original Poster
Rep: Reputation: Disabled
got it now
thanks for the replies.

--
Anji
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the difference between whereis and which commands elias_vc Linux - Newbie 17 07-11-2008 04:10 PM
what is the difference of the commands ust Linux - Newbie 2 04-29-2008 02:27 AM
what is the difference between these commands ls * and echo * izrafel Linux - General 5 06-12-2007 12:49 PM
what's the difference between the two commands? edenCC Linux - General 4 01-05-2007 09:34 AM
I can't see the difference between the two commands xailer Linux - Newbie 3 11-21-2003 02:14 PM


All times are GMT -5. The time now is 03:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration