Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Dec 2007 15:04:25 +0100
From:      Ivan Voras <ivoras@freebsd.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: How to know total number of bytes of a directory
Message-ID:  <fk5vl9$o97$1@ger.gmane.org>
In-Reply-To: <47667E61.70602@gmail.com>
References:  <32989.217.114.136.135.1197898685.squirrel@mail.dsa.es> <47667E61.70602@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig377DC6BD9ABF2DA39E2B53AD
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Andy Greenwood wrote:
> DSA - JCR wrote:
>> Hi all
>>
>> I would like to know the total number of bytes of a directory and its
>> related subdirs, occupied by the files inside it. I haven't found any
>> command for knowning it.
>>  =20
>=20
> # du -s /etc
> 17008   /etc
>=20
> You need read privs to all the subdirectories, otherwise you'll get
> permission errors and it'll skip those. Note that this displays usage i=
n
> 512-byte blocks, not bytes, but you should be able to figure it out fro=
m
> there.

Just add "-h":

# du -sh /etc
2.1M    /etc


--------------enig377DC6BD9ABF2DA39E2B53AD
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)

iD8DBQFHZoHpldnAQVacBcgRAvttAJ4qyHfMLwjqfyGoQF/xMhhwkZ2BrQCgyxmj
Mnf6yHZrdmeYOp/8HsxOs/k=
=NJDs
-----END PGP SIGNATURE-----

--------------enig377DC6BD9ABF2DA39E2B53AD--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?fk5vl9$o97$1>