Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 02-24-2010, 08:49 AM   #1
Registered: Aug 2007
Location: Salvador, Brazil
Distribution: Debian, Ubuntu
Posts: 185

Rep: Reputation: 15
Debian / Wrong free space / "du" and "ls" show different space use

I can't find out why that are invisible files using /var/log space
# du -hs .
5,3G    .
# ls -lha | more
total 11M
I've already used reiserfsck and nothing changed.

Old 02-24-2010, 09:03 AM   #2
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
On my system the two commands give the same result. Were you running the commands as root?

Note: /var/log does not typically contain hidden files. Your command (du -h .) means to run du -h on the current directory. Just running "du -h" does the same thing.
Old 02-24-2010, 09:15 AM   #3
Senior Member
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
du is measuring space used in the current directory and subdirectories.

ls -lha is only looking in the current directory.

ls -R -lha | more
But it could take a while ...

You will have to add up each directorys total to get a final total.

du -hs .
run as a user from /home/user on my system gives 753G

du -hsS .
run as a user from /home/user on my system gives 52M

ls -lha | more
run as a user from /home/user gives 53M

man du

man ls

Last edited by smoker; 02-24-2010 at 09:24 AM.
Old 02-25-2010, 11:55 AM   #4
Registered: Aug 2007
Location: Salvador, Brazil
Distribution: Debian, Ubuntu
Posts: 185

Original Poster
Rep: Reputation: 15
my bad. you are correct. there is a directory "/var/log/apache2" that has 5.1GB . That's was the problem.


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
"clean" or emptying trash does not free up enough space for updates kevishnu Linux - Newbie 2 09-25-2009 06:12 PM
How to link "free space on Hard Drive to LINUX" navin_karnam Linux - Desktop 2 06-21-2007 03:14 AM
Allocating free disk space - start of "/ " needs moving. ibex Linux - General 4 04-17-2006 09:46 PM
Mandrake 10.1 - Linux doesn't "see" free hard drive space scottlyter Linux - General 3 10-15-2004 04:39 PM
"no space left on device" - But df shows free space! monita Linux - General 7 03-30-2004 01:14 PM

All times are GMT -5. The time now is 07:41 AM.

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