Rex::C...rocess(3pm)
π NAME π
Rex::Commands::Process β literally the process management commands module, bestie. It lives in the Rex::C...rocess(3pm) page of the User Contributed Perl Documentation, and it's here to help you wrangle processes like the main character you are. π
β¨ DESCRIPTION β¨
okay so. With this module you can manage processes. List them, kill them, and so on. That's the whole vibe. π¦
A couple of things you need to know though, no cap:
- Version <= 1.0: all these functions will not be reported. π
- All these functions are not idempotent. So likeβ¦ running them twice is not the same as running them once. Don't @ me, that's just the facts. π«Ά
πΈ SYNOPSIS πΈ
kill $pid;
killall "apache2";
nice($pid, $level);
that's the whole teaser. iconic. π
π EXPORTED FUNCTIONS π
π
kill($pid, $sig)
Will kill the given process id. If $sig is specified it will kill with the given signal. π₯
task "kill", "server01", sub {
kill 9931;
kill 9931, -9;
};
π¦ killall($name, $sig)
Will kill the given process. If $sig is specified it will kill with the given signal. (Yes bestie, it's the same energy as kill, just by name instead of pid.) π
task "kill-apaches", "server01", sub {
killall "apache2";
killall "apache2", -9;
};
π ps
List all processes on a system. Will return all fields of a ps aux. The way that it just hands you everything?? obsessed. π
task "ps", "server01", sub {
for my $process (ps()) {
say "command > " . $process->{"command"};
say "pid > " . $process->{"pid"};
say "cpu-usage> " . $process->{"cpu"};
}
};
On most operating systems it is also possible to define custom parameters for ps() function. Slay. β¨
task "ps", "server01", sub {
my @list = grep { $_->{"ni"} == -5 } ps("command","ni");
};
This example would contain all processes with a nice of -5. lowkey a flex, highkey useful. π§
π nice($pid, $level)
Renice a process identified by $pid with the priority $level. Yes queen, adjust that niceness. π
task "renice", "server01", sub {
nice (153, -5);
};
β quick vibe check, bestie: these are not idempotent, so please don't loop them like they're free. π
and that's the page!! π this was Rex::C...rocess(3pm) from the User Contributed Perl Documentation, generated with perl v5.40.1 on 2025-10-03. go manage some processes, you absolute icon. πΈπ«Ά
π¦ where this page comes from
- ubuntu resolute: rex 1.16.1-1 Β· Apache-2.0
- ubuntu stonking: rex 1.16.1-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms