[ale] How to list directory sizes?

Matt Shade mshade at threekay.com
Wed Oct 3 14:59:19 EDT 2001


No, the numbers on the left are NOT sizes. They are inode numbers.

Here's an example for you:
chessie:~ # ls -ial
total 15
  32641 drwx--x--x   4 root     root         1024 Sep  6 17:31 .
      2 drwxr-xr-x  21 root     root         1024 Sep  4 01:16 ..
  32825 -rw-------   1 root     root         6839 Sep 20 22:46 .bash_history
  91981 drwxr-xr-x   5 root     root         1024 Sep  7 12:37 .cpan
  32642 -rw-r--r--   1 root     root         1124 Jun 20  2000 .exrc
  32643 -rw-r--r--   1 root     root         1301 Jun 20  2000 .xinitrc
 124441 drwxr-xr-x   2 root     root         1024 Aug 28  1994 bin
chessie:~ # ll bin
total 2
drwxr-xr-x   2 root     root         1024 Aug 28  1994 .
drwx--x--x   4 root     root         1024 Sep  6 17:31 ..

You're saying that my directory ./bin should be 124k in size. But there
nothing in it. Now with du:
chessie:~ # du -sk bin
1       bin
chessie:~ # du -sk
37015   .
chessie:~ # du -sk .cpan
37002   .cpan

As you can see, bin takes up 1k, all directories below take up a total of
37MB, and .cpan takes up most all of that. I summarized because there were
too many subdirectories to list, but just a plain du -k will show just
directories and their size in kilobytes below the current directory.

Matt

----- Original Message -----
From: "Charles Marcus" <CharlesM at Media-Brokers.com>
To: ale at ale.org
To: "Atlanta Linux User Group (E-mail)" <ale at ale.org>
Sent: Wednesday, October 03, 2001 14:40
Subject: RE: [ale] How to list directory sizes?


> Hmmm..
>
> Are you saying when I do a ls -ial, the numbers on the far left column are
> NOT the size of the directories?  They look right...
>
> bash-2.04# ls -ial
> total 88
>       2 drwxr-xr-x   21 root     root         4096 Oct  3 13:53 .
>       2 drwxr-xr-x   20 root     root         4096 Oct  2 14:38 ..
>   32769 drwxr-xr-x    2 root     root         4096 Jun 28 23:08 Backup
> 2621451 drwx------    4 523      users        4096 Aug  3 15:30 CharlesM
> 4669441 drwx------   11 defuser  users        4096 Sep 28 00:08 defuser
> 3391564 drwxr-xr-x    3 root     root         4096 Aug 15 11:23 httpd
>  180230 drwx------   18 IanB     users        4096 Oct  2 17:20 IanB
> 2326542 drwx------   18 LindaW   users        8192 Oct  3 14:02 LindaW
> 2572300 drwxr-xr-x    2 root     root         4096 Jun  4 22:38 lost+found
> 6242320 drwx------   13 MikeH    users        4096 Oct  2 14:37 MikeH
> 3325956 drwx------   15 NancyK   users        4096 Sep 10 12:22 NancyK
> 5980208 drwx------   12 PatrickC users        4096 Aug 17 20:21 PatrickC
>  507931 drwx------   21 PhilB    users        4096 Oct  2 14:37 PhilB
>  393240 drwxr-xr-x    3 root     root         4096 Jul  9 11:36
PhilB-Backup
> 5062683 drwx------   17 RayA     users        4096 Oct  3 13:15 RayA
> 4177967 drwx------   13 RichardR users        4096 Oct  3 10:00 RichardR
> 4816938 drwxr-xr-x    7 root     users        4096 Jun 28 20:02 Shared
> 2605092 drwx------   15 SimonP   users        4096 Aug 20 16:55 SimonP
> 1949713 drwxr-xr-x   10 sympa    sympa        4096 Aug 30 17:03 sympa
> 1818673 drwx------   13 TerryM   users        4096 Oct  1 13:52 TerryM
> 1048630 drwx------   13 TJE      users        4096 Oct  3 09:42 TJE
>
> -----Original Message-----
> From: Matt Shade [mailto:mshade at threekay.com]
> Sent: Wednesday, October 03, 2001 1:43 PM
> To: Charles Marcus; Atlanta Linux User Group (E-mail)
> Subject: Re: [ale] How to list directory sizes?
>
>
> If you just want to see the sizes of all directories in a tree, try:
> du
> du -k  <- shows it in kilobytes
> du -m  <- shows it in megabytes
> du -s  <- summarizes the whole tree
>
> type du --help to see what else you can get.
>
> Matt
>
>
> > I've looked, and can't seem to find how to do this - I know it must be
> > simple...
> >
> > How can I get the size of the directories in an ls listing?
> >
> > Thanks
> >
> > Charles
> >
> >
> > --
> > To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message
> body.
>
>
> --
> To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message
body.






More information about the Ale mailing list