Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu User (http://www.linux-archive.org/ubuntu-user/)
-   -   How to list directory size? (http://www.linux-archive.org/ubuntu-user/115185-how-list-directory-size.html)

"Robert Dailey" 06-28-2008 04:33 PM

How to list directory size?
 
On Sat, Jun 28, 2008 at 11:11 AM, Karl Larsen <k5di@zianet.com> wrote:

Robert Dailey wrote:

> Hi,

>

> I'm currently using Ubuntu Server 8. Is there a way to use the 'ls' command

> to display the size of a directory? That is, the size should be the added

> size of the contents of files and other subdirectories (recursive).

>

>

* *I use $du -h which tells you how many gigabytes you have.
That's almost what I'm looking for, except I don't want it to be recursive.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Corey Bettenhausen 06-28-2008 05:07 PM

How to list directory size?
 
Robert Dailey wrote:
> On Sat, Jun 28, 2008 at 11:11 AM, Karl Larsen <k5di@zianet.com> wrote:
>
>> Robert Dailey wrote:
>>> Hi,
>>>
>>> I'm currently using Ubuntu Server 8. Is there a way to use the 'ls'
>> command
>>> to display the size of a directory? That is, the size should be the added
>>> size of the contents of files and other subdirectories (recursive).
>>>
>>>
>> I use $du -h which tells you how many gigabytes you have.
>
>
> That's almost what I'm looking for, except I don't want it to be recursive.
So, which is it? Recursive or not? Either way, "man du". Take note of
the "--max-depth" option. I usually like the "-c" option as well.
-Corey

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

"Robert Dailey" 06-28-2008 05:15 PM

How to list directory size?
 
On Sat, Jun 28, 2008 at 12:07 PM, Corey Bettenhausen <corey@31415926535.com> wrote:

Robert Dailey wrote:

> On Sat, Jun 28, 2008 at 11:11 AM, Karl Larsen <k5di@zianet.com> wrote:

>

>> Robert Dailey wrote:

>>> Hi,

>>>

>>> I'm currently using Ubuntu Server 8. Is there a way to use the 'ls'

>> command

>>> to display the size of a directory? That is, the size should be the added

>>> size of the contents of files and other subdirectories (recursive).

>>>

>>>

>> * * I use $du -h which tells you how many gigabytes you have.

>

>

> That's almost what I'm looking for, except I don't want it to be recursive.

So, which is it? *Recursive or not? *Either way, "man du". *Take note of

the "--max-depth" option. *I usually like the "-c" option as well.

-Corey
When I mentioned "recursive" in my original post, I was referring to the math- The math that calculates the size of the folder should be recursive, in that it will search the directory tree for all files under the folder in question and add their sizes together to form the final directory size. The display routine itself should *NOT* be recursive, as I only care to see the size of a specific folder and NOT its contents.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Mike Bird 06-28-2008 05:30 PM

How to list directory size?
 
On Sat June 28 2008 10:15:34 Robert Dailey wrote:
> On Sat, Jun 28, 2008 at 12:07 PM, Corey Bettenhausen
> <corey@31415926535.com>
>
> wrote:
> > Robert Dailey wrote:
> > > On Sat, Jun 28, 2008 at 11:11 AM, Karl Larsen <k5di@zianet.com> wrote:
> > >> Robert Dailey wrote:
> > >>> Hi,
> > >>>
> > >>> I'm currently using Ubuntu Server 8. Is there a way to use the 'ls'
> > >>
> > >> command
> > >>
> > >>> to display the size of a directory? That is, the size should be the
> >
> > added
> >
> > >>> size of the contents of files and other subdirectories (recursive).
> > >>
> > >> I use $du -h which tells you how many gigabytes you have.
> > >
> > > That's almost what I'm looking for, except I don't want it to be
> >
> > recursive.
> > So, which is it? Recursive or not? Either way, "man du". Take note of
> > the "--max-depth" option. I usually like the "-c" option as well.
> > -Corey
>
> When I mentioned "recursive" in my original post, I was referring to the
> math- The math that calculates the size of the folder should be recursive,
> in that it will search the directory tree for all files under the folder in
> question and add their sizes together to form the final directory size. The
> display routine itself should *NOT* be recursive, as I only care to see the
> size of a specific folder and NOT its contents.

When you carefully read "man du" before posting this question you must have
accidently overlooked the "-s" switch.

--Mike Bird

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

"Robert Dailey" 06-28-2008 05:46 PM

How to list directory size?
 
On Sat, Jun 28, 2008 at 12:30 PM, Mike Bird <mgb-ubuntu@yosemite.net> wrote:

On Sat June 28 2008 10:15:34 Robert Dailey wrote:

> On Sat, Jun 28, 2008 at 12:07 PM, Corey Bettenhausen

> <corey@31415926535.com>

>

> wrote:

> > Robert Dailey wrote:

> > > On Sat, Jun 28, 2008 at 11:11 AM, Karl Larsen <k5di@zianet.com> wrote:

> > >> Robert Dailey wrote:

> > >>> Hi,

> > >>>

> > >>> I'm currently using Ubuntu Server 8. Is there a way to use the 'ls'

> > >>

> > >> command

> > >>

> > >>> to display the size of a directory? That is, the size should be the

> >

> > added

> >

> > >>> size of the contents of files and other subdirectories (recursive).

> > >>

> > >> * * I use $du -h which tells you how many gigabytes you have.

> > >

> > > That's almost what I'm looking for, except I don't want it to be

> >

> > recursive.

> > So, which is it? *Recursive or not? *Either way, "man du". *Take note of

> > the "--max-depth" option. *I usually like the "-c" option as well.

> > -Corey

>

> When I mentioned "recursive" in my original post, I was referring to the

> math- The math that calculates the size of the folder should be recursive,

> in that it will search the directory tree for all files under the folder in

> question and add their sizes together to form the final directory size. The

> display routine itself should *NOT* be recursive, as I only care to see the

> size of a specific folder and NOT its contents.



When you carefully read "man du" before posting this question you must have

accidently overlooked the "-s" switch.
I posted this question because I didn't know about 'du'...

-s switch did the trick.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

epuster 06-28-2008 06:13 PM

How to list directory size?
 
Robert Dailey wrote:
> On Sat, Jun 28, 2008 at 12:30 PM, Mike Bird <mgb-ubuntu@yosemite.net
> <mailto:mgb-ubuntu@yosemite.net>> wrote:
>
> On Sat June 28 2008 10:15:34 Robert Dailey wrote:
> > On Sat, Jun 28, 2008 at 12:07 PM, Corey Bettenhausen
> > <corey@31415926535.com <mailto:corey@31415926535.com>>
> >
> > wrote:
> > > Robert Dailey wrote:
> > > > On Sat, Jun 28, 2008 at 11:11 AM, Karl Larsen
> <k5di@zianet.com <mailto:k5di@zianet.com>> wrote:
> > > >> Robert Dailey wrote:
> > > >>> Hi,
> > > >>>
> > > >>> I'm currently using Ubuntu Server 8. Is there a way to use
> the 'ls'
> > > >>
> > > >> command
> > > >>
> > > >>> to display the size of a directory? That is, the size
> should be the
> > >
> > > added
> > >
> > > >>> size of the contents of files and other subdirectories
> (recursive).
> > > >>
> > > >> I use $du -h which tells you how many gigabytes you have.
> > > >
> > > > That's almost what I'm looking for, except I don't want it to be
> > >
> > > recursive.
> > > So, which is it? Recursive or not? Either way, "man du".
> Take note of
> > > the "--max-depth" option. I usually like the "-c" option as well.
> > > -Corey
> >
> > When I mentioned "recursive" in my original post, I was
> referring to the
> > math- The math that calculates the size of the folder should be
> recursive,
> > in that it will search the directory tree for all files under
> the folder in
> > question and add their sizes together to form the final
> directory size. The
> > display routine itself should *NOT* be recursive, as I only care
> to see the
> > size of a specific folder and NOT its contents.
>
> When you carefully read "man du" before posting this question you
> must have
> accidently overlooked the "-s" switch.
>
>
> I posted this question because I didn't know about 'du'...
>
> -s switch did the trick.
If you're interested in seeing how space is distributed, rather than
capturing text output, you can also use the Disk Usage Analyzer under
Applications -> Accessories.

- Eric

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

"Robert Dailey" 06-28-2008 06:19 PM

How to list directory size?
 
On Sat, Jun 28, 2008 at 1:13 PM, epuster <epuster@eecs.utk.edu> wrote:

Robert Dailey wrote:

> On Sat, Jun 28, 2008 at 12:30 PM, Mike Bird <mgb-ubuntu@yosemite.net

> <mailto:mgb-ubuntu@yosemite.net>> wrote:

>

> * * On Sat June 28 2008 10:15:34 Robert Dailey wrote:

> * * > On Sat, Jun 28, 2008 at 12:07 PM, Corey Bettenhausen

> * * > <corey@31415926535.com <mailto:corey@31415926535.com>>

> * * >

> * * > wrote:

> * * > > Robert Dailey wrote:

> * * > > > On Sat, Jun 28, 2008 at 11:11 AM, Karl Larsen

> * * <k5di@zianet.com <mailto:k5di@zianet.com>> wrote:

> * * > > >> Robert Dailey wrote:

> * * > > >>> Hi,

> * * > > >>>

> * * > > >>> I'm currently using Ubuntu Server 8. Is there a way to use

> * * the 'ls'

> * * > > >>

> * * > > >> command

> * * > > >>

> * * > > >>> to display the size of a directory? That is, the size

> * * should be the

> * * > >

> * * > > added

> * * > >

> * * > > >>> size of the contents of files and other subdirectories

> * * (recursive).

> * * > > >>

> * * > > >> * * I use $du -h which tells you how many gigabytes you have.

> * * > > >

> * * > > > That's almost what I'm looking for, except I don't want it to be

> * * > >

> * * > > recursive.

> * * > > So, which is it? *Recursive or not? *Either way, "man du".

> * * *Take note of

> * * > > the "--max-depth" option. *I usually like the "-c" option as well.

> * * > > -Corey

> * * >

> * * > When I mentioned "recursive" in my original post, I was

> * * referring to the

> * * > math- The math that calculates the size of the folder should be

> * * recursive,

> * * > in that it will search the directory tree for all files under

> * * the folder in

> * * > question and add their sizes together to form the final

> * * directory size. The

> * * > display routine itself should *NOT* be recursive, as I only care

> * * to see the

> * * > size of a specific folder and NOT its contents.

>

> * * When you carefully read "man du" before posting this question you

> * * must have

> * * accidently overlooked the "-s" switch.

>

>

> I posted this question because I didn't know about 'du'...

>

> -s switch did the trick.

If you're interested in seeing how space is distributed, rather than

capturing text output, you can also use the Disk Usage Analyzer under

Applications -> Accessories.
Thanks Eric for your help, but I'm using Ubuntu Server and I don't have a GUI. Unless I'm misunderstanding, I don't think I can use the advice you've given me, although it does sound useful.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Uwe Sander 06-28-2008 06:36 PM

How to list directory size?
 
Am Samstag, den 28.06.2008, 11:33 -0500 schrieb Robert Dailey:
> That's almost what I'm looking for, except I don't want it to be
> recursive.

try also 'du -h -s' and 'du -h -s *'

Uwe


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Jeremy Huntwork 06-28-2008 06:37 PM

How to list directory size?
 
On Jun 28, 2008, at 2:13 PM, epuster wrote:

> Robert Dailey wrote:
>> On Sat, Jun 28, 2008 at 12:30 PM, Mike Bird <mgb-ubuntu@yosemite.net
>> <mailto:mgb-ubuntu@yosemite.net>> wrote:
>>
>> On Sat June 28 2008 10:15:34 Robert Dailey wrote:
>>> On Sat, Jun 28, 2008 at 12:07 PM, Corey Bettenhausen
>>> <corey@31415926535.com <mailto:corey@31415926535.com>>
>>>
>>> wrote:
>>>> Robert Dailey wrote:
>>>>> On Sat, Jun 28, 2008 at 11:11 AM, Karl Larsen
>> <k5di@zianet.com <mailto:k5di@zianet.com>> wrote:

[snipped about 50 emails]

Does no one believe in trimming their replies?


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Karl Larsen 06-28-2008 06:42 PM

How to list directory size?
 
Robert Dailey wrote:
> On Sat, Jun 28, 2008 at 11:11 AM, Karl Larsen <k5di@zianet.com> wrote:
>
>
>> Robert Dailey wrote:
>>
>>> Hi,
>>>
>>> I'm currently using Ubuntu Server 8. Is there a way to use the 'ls'
>>>
>> command
>>
>>> to display the size of a directory? That is, the size should be the added
>>> size of the contents of files and other subdirectories (recursive).
>>>
>>>
>>>
>> I use $du -h which tells you how many gigabytes you have.
>>
>
>
> That's almost what I'm looking for, except I don't want it to be recursive.
>
>
Read man du. It might be possible to make it non-recursive, but for
the life of me I can't think of why you want that.


Karl


--

Karl F. Larsen, AKA K5DI
Linux User
#450462 http://counter.li.org.
PGP 4208 4D6E 595F 22B9 FF1C ECB6 4A3C 2C54 FE23 53A7


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


All times are GMT. The time now is 10:14 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.