Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


Closed Thread
  Search this Thread
Old 06-22-2007, 09:07 AM   #1
Registered: Jun 2006
Posts: 126

Rep: Reputation: 15
disk space calculation

Strangely I see two values, with two different ways,

lets say I have PATH_A

with Directory_A
& Directory _B

I want to know the size of Directory_A
First Way
When I say

ls -l PATH_A

it gives size of 335872 for Directory_A ( converting to MB i.e dividing by 1024 twice = approx 0.32MB)

Second Way
when I say

du -k -s PATH_A/Directory_A

I get

113127 [converting to MB i.e. divinding by 1024 once = approx 110MB ]
Old 06-22-2007, 09:35 AM   #2
Simon Bridge
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
That's right, they are measuring different things.
Old 06-22-2007, 10:07 AM   #3
Registered: Jun 2006
Posts: 126

Original Poster
Rep: Reputation: 15
My case is reverse

du -k -s gives 110MB
ls -l gives 0.3MB
Old 06-22-2007, 12:53 PM   #4
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 469Reputation: 469Reputation: 469Reputation: 469Reputation: 469
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Closed Thread

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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cedega "Disk space required for the installation exceeds available disk space" Solved Spewdemon Member Success Stories 1 10-18-2007 06:19 PM
Wrong calculation of free disk space by kdiskfree AGazzaz Mandriva 2 02-09-2006 06:25 AM
Drive space calculation? Redhatusr Linux - Software 2 01-07-2005 01:11 PM
3Gb of disk space lost! Disk space problem or mother board conflicts with HDD Mistreated Linux - Hardware 4 12-06-2004 03:58 PM
Disk space wastage 73 GB Hard disk rajgopalhg Linux - Hardware 2 10-18-2002 03:41 PM

All times are GMT -5. The time now is 03:59 PM.

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