LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 02-24-2010, 08:49 AM   #1
brgsousa
Member
 
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


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

regards
 
Old 02-24-2010, 09:03 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

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

ls -lha is only looking in the current directory.

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

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

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


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


Code:
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
brgsousa
Member
 
Registered: Aug 2007
Location: Salvador, Brazil
Distribution: Debian, Ubuntu
Posts: 185

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:40 PM.

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
Open Source Consulting | Domain Registration