You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
523 B
Perl
20 lines
523 B
Perl
# chezmoi:template:left-delimiter=#{{
|
|
#{{- /* vim: set filetype=perl: */ -}}
|
|
#{{ if .include_legacy -}}
|
|
#!/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 -s \"$realFileName\"";
|
|
print `$fileSortedPrintCmd`;
|
|
}
|
|
#{{- end }}
|