diff --git a/bin/filesize b/bin/filesize new file mode 100755 index 0000000..06352c8 --- /dev/null +++ b/bin/filesize @@ -0,0 +1,16 @@ +#!/usr/bin/env perl + +# Get sorted list files +my @sortedFiles = `du -s * | sort -nr`; + +foreach my $file (@sortedFiles) { + # Get just the file name, remove size + my @fileName = split("\t", $file); + my $realFileName = @fileName[1]; + chomp($realFileName); + + # Print the size of the file and the file size + my $fileSortedPrintCmd = "du -hs \"$realFileName\""; + print `$fileSortedPrintCmd`; +} +