From: Jack on
I need to get the size of a directory with several sub-directories.
Each sub-directory may also have sub-directories. How to do it?

Thanks.
From: Janis Papanagnou on
Jack wrote:
> I need to get the size of a directory with several sub-directories.
> Each sub-directory may also have sub-directories. How to do it?

du -k your_top_dir_path

Janis

>
> Thanks.
From: Seebs on
On 2010-05-08, Jack <junw2000(a)gmail.com> wrote:
> I need to get the size of a directory with several sub-directories.
> Each sub-directory may also have sub-directories. How to do it?

Define "size". "du" may well do what you need.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam(a)seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
From: Jack on
On May 8, 3:24 pm, Janis Papanagnou <janis_papanag...(a)hotmail.com>
wrote:
> Jack wrote:
> > I need to get the size of a directory with several sub-directories.
> > Each sub-directory may also have sub-directories. How to do it?
>
>   du -k your_top_dir_path
>
> Janis
>
>
>
> > Thanks.

I tried "du -k my_dir" and found that it lists the size of each file
in the directory. What I want is the size (usage of disk space) of the
whole directory. I do not need the size of each file, For example, if
the directory occupies 20GB on the disk, I only need to know the
number 20GB, which should be the summation of the size of all the
files. Is there any way to do it?

Thanks.
From: Stephane CHAZELAS on
2010-05-10, 00:17(-07), Jack:
[...]
> I tried "du -k my_dir" and found that it lists the size of each file
> in the directory. What I want is the size (usage of disk space) of the
> whole directory. I do not need the size of each file, For example, if
> the directory occupies 20GB on the disk, I only need to know the
> number 20GB, which should be the summation of the size of all the
> files. Is there any way to do it?
[...]

Try "man du"

--
Stéphane