Perl Snippet to tell you how many files in a directory.
Published October 4th, 2008 in PERL, ProgrammmingGreat little perl snippet to let you know the number of files and directories in the current directory. Run from the command line.
ls -l |perl -e ‘while(<>){$h{substr($_,0,1)}+=1;} END {foreach(keys %h){print “$_ $h{$_}\n”;}}’

No Responses to “Perl Snippet to tell you how many files in a directory.”
Please Wait
Leave a Reply