LinuxQuestions.org
Visit Jeremy's Blog.
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, 09: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, 10:03 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

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

Rep: Reputation: 248Reputation: 248Reputation: 248
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 10:24 AM.
 
Old 02-25-2010, 12:55 PM   #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


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 07:12 PM
How to link "free space on Hard Drive to LINUX" navin_karnam Linux - Desktop 2 06-21-2007 04:14 AM
Allocating free disk space - start of "/ " needs moving. ibex Linux - General 4 04-17-2006 10:46 PM
Mandrake 10.1 - Linux doesn't "see" free hard drive space scottlyter Linux - General 3 10-15-2004 05:39 PM
"no space left on device" - But df shows free space! monita Linux - General 7 03-30-2004 02:14 PM


All times are GMT -5. The time now is 07:07 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration