du.php – PHP Disk Usage script

I’m starting to copy my scripts from https://justynshull.com/oldsite/phpscripts.html but figured I’d start with this one so I can get the syntax hilighting/formatting down with wordpress.

1
2
3
4
5
6
7
8
9
10
11
12
 <?php
 // $a = shell_exec('df -h');
//echo getenv('DOCUMENT_ROOT');
chdir(getenv('DOCUMENT_ROOT'));
chdir('..');
echo shell_exec('pwd');
$a = shell_exec('du -hx *');
//$a = shell_exec('ls -l');
echo '<h2>Disk space</h2>< pre>';
echo $a;
echo '< /pre>';
 ?>

One Response to “du.php – PHP Disk Usage script”

  1. du2.php | JustynShull.com Says:

    [...] du.php [...]

Leave a Reply