LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Confusing "ls -lh" output (https://www.linuxquestions.org/questions/linux-newbie-8/confusing-ls-lh-output-285672/)

Jeozp 02-03-2005 03:26 AM

Confusing "ls -lh" output
 
When I try to chek the size of a directory on my Debian box they are all 4.0k large, all of them even the ones that are empty. How can that be? Is there a specific arguument I have to give to ls? I can't use any GUI on this machine so I cant check how it would look like in Gnome or KDE.
All of my parttitions are ext2 if that metters.

Mega Man X 02-03-2005 03:59 AM

"ls -s"

or

"du -a"

maybe :(

Cydizen 02-03-2005 04:03 AM

Hi Jeozp,

Here is what I do. I am sure there are other ways, but this works for me.

If I want to see the size of my /home/bruce directory, this is the command I would run:

du -sh /home/bruce (substitute with your own user)

The alternative is you could run that command from the directory of which you need this size:

cd /home/bruce
du -sh

Another alternative is if you want to see how subdirectories break down, just run

du -s /home/bruce

The last line of that result will be the total for all the directories.

Hope this helps,

Cheers,
Bruce

Cydizen 02-03-2005 04:08 AM

by the way, the "h" make the output "human readable"

exp: 297613 or with 'h' 291M


-B

Jeozp 02-03-2005 04:27 AM

Thx all, it helped :)


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