Find all large files on a Linux
Friday, April 18th, 2008 Posted in Linux | No Comments »Taken from: http://snippets.dzone.com/posts/show/1491 Finds all files over 20,000KB (roughly 20MB) in size and presents their names and size in a human readable format: find / -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 ...
Perl inarray function
Friday, April 18th, 2008 Posted in Programare | No Comments »Taken from: http://assasiner.wordpress.com/2006/12/03/is-in-array/trackback/ You can use grep for this task like this: if(grep $_ eq $string, @array) orĀ if you want regular expressions: if(grep /$string/, @array) As an example: #!/usr/bin/perl my $string = "in_helm"; my @array = qw/full_plate manteau boots two_handed_sword fin_helm/; if(grep $_ eq $string, @array) { print ...