Sys::S...skUsage(3pm)
π Sys::Statistics::Linux::DiskUsage π
okay bestie, so this is a page from the User Contributed Perl Documentation and it's literally all about peeking at your disk usage on Linux. it's giving main character energy for your filesystem. let's go β¨
πΈ NAME πΈ
Sys::Statistics::Linux::DiskUsage β collect linux disk usage. that's it, that's the whole job, and she does it beautifully π
π¦ SYNOPSIS π¦
use Sys::Statistics::Linux::DiskUsage;
my $lxs = new Sys::Statistics::Linux::DiskUsage;
my $stat = $lxs->get;
boom. two lines and you're already getting stats. iconic behavior tbh.
π DESCRIPTION π
Sys::Statistics::Linux::DiskUsage gathers the disk usage with the command df. no cap, that's the whole vibe β she shells out to df and hands you the tea π«
if you want the full lore, go read the documentation of the front-end module Sys::Statistics::Linux. iykyk.
π DISK USAGE INFORMATIONS π
so this info is generated by /bin/df -kP. here's what you're getting back:
totalβ the total size of the disk πusageβ the used disk space in kilobytes πfreeβ the free disk space in kilobytes ποΈusageperβ the used disk space in percent πmountpointβ the mount point of the disk π§
β¨ GLOBAL VARS β¨
so like⦠if you wanna change the path or the arguments for df, you absolutely can, bestie. just poke these variables:
$Sys::Statistics::Linux::DiskUsage::DF_PATH = '/bin';
$Sys::Statistics::Linux::DiskUsage::DF_CMD = 'df -akP';
Example:
use Sys::Statistics::Linux;
use Sys::Statistics::Linux::DiskUsage;
$Sys::Statistics::Linux::DiskUsage::DF_CMD = 'df -akP';
my $sys = Sys::Statistics::Linux->new(diskusage => 1);
my $disk = $sys->get;
custom df command? we love to see it. glow up π
π METHODS π
π new()
call new() to create a new object. it's that simple, no drama:
my $lxs = Sys::Statistics::Linux::DiskUsage->new;
and yes, you can also set the path to df. very customizable of her:
Sys::Statistics::Linux::DiskUsage->new(
cmd => {
# This is the default
path => '/bin',
df => 'df -kP 2>/dev/null',
}
);
π get()
call get() to get the statistics. get() returns the statistics as a hash reference. so like, you get a whole hash ref back, go wild with it π
my $stat = $lxs->get;
π EXPORTS π
no exports. none. zero. she's self-contained and unbothered π
π«Ά SEE ALSO π«Ά
df(1) β go say hi to the OG π
π REPORTING BUGS π
please report all bugs to <jschulz.cpan(at)bloonix.de>. don't be shy, she wants to know π
πΈ AUTHOR πΈ
Jonny Schulz <jschulz.cpan(at)bloonix.de>. periodt. π
β COPYRIGHT β
Copyright (c) 2006, 2007 by Jonny Schulz. All rights reserved.
this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay β¨
fr fr that's the whole page, no cap πΈ
okay so final vibes check: this whole thing is perl v5.36.0, dated 2022-11-19, and yeah the header got a little cut off up top but you know exactly what it is. go check your disks bestie, ily πππ¦
π¦ where this page comes from
- debian bookworm: libsys-statistics-linux-perl 0.66-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libsys-statistics-linux-perl 0.66-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libsys-statistics-linux-perl 0.66-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libsys-statistics-linux-perl 0.66-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libsys-statistics-linux-perl 0.66-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms