Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > Your Distro > Redhat / Fedora Linux Help > disk usage in a partition

Forgot Password?
 Redhat / Fedora Linux Help   Help and discussion related to Redhat and Fedora Linux.

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 07-04-2009   #1 (permalink)
Just Joined!
 
Join Date: Jan 2008
Posts: 19
Talking disk usage in a partition

I want to find the amount of free space in the / partition in my machine.
i am using the following two commands for the same .
1. du -h
2. df -h

but i am getting different disk usage figures.

The df -h command states i have only used 4.7G of space :


[root@nnii0232 /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 38G 4.7G 32G 13% /
/dev/sda2 190M 9.9M 171M 6% /boot
tmpfs 1009M 0 1009M 0% /dev/shm
/dev/sda5 15G 5.9G 7.7G 44% /ora10gas

when i use du -h /

0 /sys/devices/platform/i8042/serio1/power
0 /sys/devices/platform/i8042/serio1
0 /sys/devices/platform/i8042/serio0/id
0 /sys/devices/platform/i8042/serio0/power
0 /sys/devices/platform/i8042/serio0
0 /sys/devices/platform/i8042/power
0 /sys/devices/platform/i8042
0 /sys/devices/platform/serial8250/power
0 /sys/devices/platform/serial8250
0 /sys/devices/platform/pcspkr/power
0 /sys/devices/platform/pcspkr
0 /sys/devices/platform/power
0 /sys/devices/platform
0 /sys/devices
0 /sys/fs/fscache
0 /sys/fs
0 /sys
11G /


it states i have used 11GB space . Why is this difference between the two commands.

pl help me with this.
Thanks in advance .

Anshul
anshulsahdev is offline  


Reply With Quote
Old 07-04-2009   #2 (permalink)
Trusted Penguin
 
Roxoff's Avatar
 
Join Date: Aug 2005
Location: Nottingham, England
Posts: 2,830
'df' will tell you how much space your partitions are using. 'du' scans the filesystem to tell you how much space is used, so if you have any other partitions mounted under /, it'll include those too.
__________________
Linux user #126863 - see http://counter.li.org/
Roxoff is offline   Reply With Quote
Old 07-06-2009   #3 (permalink)
Just Joined!
 
Join Date: Jan 2008
Posts: 19
Thumbs up

thanks ..this helped
anshulsahdev is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 11:51 AM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2