Disk Use Utility


#!/usr/bin/perl -w $cutoff = 9999; print "DISKUSE\n"; open(TEMPFILE, "diskuse"); @info=<TEMPFILE>; close(TEMPFILE); foreach $line (@info){ ($amount) = ($line=~ /(\d*).*/ms); if($amount > $cutoff){ print "$line"; } } #DIRECTIONS: # #First, use the du command to create a file called diskuse #for the directory tree you wish to inspect: # # du www > diskuse # #Next, run this script like this: # # ./diskuse.pl # #The output will be all directories containing more than $cutoff # #You can change this cutoff amount to suit your needs

ASSIGNMENT: