PHP:DirSize

From xbe wiki

Jump to: navigation, search

[edit] dirsize 1.0

dirsize is a command line based PHP utility. You need to have a local php interpreter (PHP binary; php-cli) in order to use it - it doesn't make sense to use it through a webserver! *g* (trust me..)

The sense of dirsize is to calculate the file size of any directory (and only directories) and their sub-directories. I made this one for my own usage as it really interested my how big this or that directory actually is. Example:

root@cypress dn # dirsize /tmp
dirsize 1.0 - calculating /tmp....

---------------------------------------------------
Report for directory < /tmp >

Total directory size: 2.623 GB
(9450 files, 1021 directories)

Averages:
Average file size: 277.618 KB
Average directory size: 2.57 MB
Average files per directory: 9.256

---------------------------------------------------

Nice, isn't it? ;-) It is very simple to use, it only takes one argument that should be a directory (or a path). It's consistent, so it ignores symbolic links in it's calculation. The tar file includes a INSTALL and README file to get you started. This tiny thing doesn't need more explanation.

[edit] Downloads

Personal tools