disk usage: du in Perl - video
du using Filesys::DiskUsage
examples/du.pl
#!/usr/bin/env perl use strict; use warnings; use Filesys::DiskUsage qw(du); if (not @ARGV) { die "Usage: $0 DIRs\n"; } my %sizes = du({'make-hash' => 1}, @ARGV); foreach my $entry (sort { $sizes{$a} <=> $sizes{$b} } keys %sizes) { print "$entry => $sizes{$entry}\n"; }

Published on 2015-08-15
Comments
In the comments, please wrap your code snippets within <pre> </pre> tags and use spaces for indentation. comments powered by Disqus
If you have any comments or questions, feel free to post them on the source of this page in GitHub. Source on GitHub.
Comment on this post