in reply to find biggest file and use awk
Check and see if File::Util is available to you. I believe it will provide you with what you want if it is available. You can find out by running instmodsh.
Hope that gives you a start...
Update!/usr/bin/perl use strict; use warnings; use File::Util; my($f) = File::Util->new(); sub filesize { my ( $selfdir, $subdirs, $files, $depth ) = @_; print "$_ " . ( -s $_ ) . "\n" for sort { (-s $a) <=> (-s $b) +} @$files; } $f->list_dir( '/tmp/dir1' => { recurse => 0, callback => \&filesize, p +attern=>'\.pl$' } );
Update_2Forgot to mention that this code is right from the POD for the File::Util module. It is not mine!
Insanity: Doing the same thing over and over again and expecting different results...
|
|---|