LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Debian / Wrong free space / "du" and "ls" show different space use (http://www.linuxquestions.org/questions/linux-software-2/debian-wrong-free-space-du-and-ls-show-different-space-use-791260/)

brgsousa 02-24-2010 09:49 AM

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

pixellany 02-24-2010 10:03 AM

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.

smoker 02-24-2010 10:15 AM

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

brgsousa 02-25-2010 12:55 PM

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


All times are GMT -5. The time now is 07:31 PM.