Complete.Org: Mailing Lists: Archives: discussion: March 1999:
Re: [aclug-L] Size of dir tree?
Home

Re: [aclug-L] Size of dir tree?

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: aclug-L@xxxxxxxxxxxx
Cc: "ACLUG-list" <ACLUG-L@xxxxxxxxxxxx>
Subject: Re: [aclug-L] Size of dir tree?
From: John Goerzen <jgoerzen@xxxxxxxxxxxx>
Date: 01 Mar 1999 10:59:26 -0600
Reply-to: aclug-L@xxxxxxxxxxxx

If you already have the partitions, you can use "df":

erwin ~$ df
Filesystem         1024-blocks  Used Available Capacity Mounted on
/dev/sdb2             197504   57107   130198     30%   /
/dev/sdb6            1981431  799524  1079485     43%   /usr
/dev/sdb7            1977358   47438  1827715      3%   /var
/dev/sda5            3674685 1589693  1894888     46%   /home
/dev/sda6            3958483 3100819   652865     83%   /ftp

This shows you how much space is available and how much is used in K.

You can also get a count of files:

erwin ~$ df -i
Filesystem           Inodes   IUsed   IFree  %IUsed Mounted on
/dev/sdb2              51000    2658   48342     5%  /
/dev/sdb6             514048   54508  459540    11%  /usr
/dev/sdb7             512000    2525  509475     0%  /var
/dev/sda5             952320   21608  930712     2%  /home
/dev/sda6            1024000   19725 1004275     2%  /ftp

This shows, for instance, that I have 54,508 files in my /usr
partition.

If you do not already have separate partitions, you can find out how
much space files in a particular directory are using by:

du -Dsk /var

Ie:

erwin:~# du -Dsk /var
47382   /var

Note that this command will have to be run as root.

You can also get a count of files:

erwin:~# find /var | wc -l
   2519


"Greg House" <ghouse@xxxxxxxxxxxxx> writes:

> This is a pretty basic question, but I haven't been able to easily find the
> answer.  How do you get the total size of a directory tree.  For example, if
> one were repartitioning and wanted to know the size of /usr or /var, how
> would you get it?
> 
> Thanks,
> Greg
> 
> ---
> This is the Air Capital Linux Users Group discussion list.  If you
> want to unsubscribe, send the word "unsubscribe" to
> aclug-L-request@xxxxxxxxxxxx.  If you want to post to the list, send your
> message to aclug-L@xxxxxxxxxxxx.
---
This is the Air Capital Linux Users Group discussion list.  If you
want to unsubscribe, send the word "unsubscribe" to
aclug-L-request@xxxxxxxxxxxx.  If you want to post to the list, send your
message to aclug-L@xxxxxxxxxxxx.



[Prev in Thread] Current Thread [Next in Thread]