Folder size incl files in subfolders - any way to show it?

Folder size incl files in subfolders - any way to show it?

Post by Gerald T Beauregar » Thu, 29 Mar 2001 18:34:20



Is there a way to get a directory listing in which the size of a folder's
contents is shown (ie the sum of the files in the folder itself, and all the
files in its subfolders)?  'ls' can't do it, AFAIK.  It always shows the
size of a directory as '512', whether it contains no files or 50MB of files.
This makes it very difficult for me as sysadmin to see quickly how space on
our server is being used up.

BTW, Windows suffers from this same problem.  By choosing right clicking on
a folder in Windows Explorer, and choosing Properties, you can see the size
of all the files in the folder and its subfolders.  What would be really
nice is if it showed up right in Windows Explorer, so you could see at a
glance what folders where chewing up all the space.  I've found an excellent
third party app that does this: TreeSize Pro by Jam Software
<http://www.jam-software.com/treesize.html>

BTW2, the MacOS has had a "compute folder sizes" feature built-in for
*years*...

-Gerry

 
 
 

Folder size incl files in subfolders - any way to show it?

Post by Stephen Montgomery-Smit » Fri, 30 Mar 2001 01:03:20



> Is there a way to get a directory listing in which the size of a folder's
> contents is shown (ie the sum of the files in the folder itself, and all the
> files in its subfolders)?  'ls' can't do it, AFAIK.  It always shows the
> size of a directory as '512', whether it contains no files or 50MB of files.
> This makes it very difficult for me as sysadmin to see quickly how space on
> our server is being used up.

The program du is what you want.  To see how much space is used in a
folder type

du -s folder

--
Stephen Montgomery-Smith

http://www.math.missouri.edu/~stephen

 
 
 

Folder size incl files in subfolders - any way to show it?

Post by Gerald T Beauregar » Fri, 30 Mar 2001 10:43:08



Quote:> The program du is what you want.  To see how much space is used in a
> folder type

> du -s folder

Thanks for the tip!  I looked up the man page, and the combination of
options that does *exactly* what I want is:

du -s -c *

This shows the sizes (in KB) of the subdirectories of the current working
directory, and the grand total:

cygron% du -s -c *
1       ISS
123     aric
17      bshepherd
1       ctan
[etc..]
49      mkaur
23      rwolf
15      vyim
76852   total

 
 
 

1. reading all files in a folder and it's subfolders

Hi,

Its long time ago that I have written my last c++ code line. Last time
I coded more in Java. In java is it very easy to read all files
recursiv to a specified path. But in C++ I have no idea.

My first attempt was to solve that by using the C method opendir() and
step through the path by readdir(). But what can I do if the next io
object isn't a file like the readdir() method expect.

So my question to you. Is there a solution on this ?

Thanks in forward
Rico

2. Change user name with admintool, old mount won't go away.

3. backup complete folder with all subfolders

4. Problem in Log file movement

5. Any ways to show files named with spaces ?

6. cdrecord w/ Iomega usb CDRW6402EXT-B

7. Ways of reducing log files sizes automatically

8. Strip Line Feed from the Kshell Variable

9. Newbie question: listing folder and file sizes

10. chmod of all the files and sub folders under one folder

11. getting the total size of a kind of files in in a folder

12. how to see the size of all files in a folder?

13. rm folders, sub-folders and files older than one hour