For example, the output of my script /usr/local/bin/fxsx
Code: Select all
#!/bin/bash
#fxsx V0.1 - like "fx|head -n 3;sx|tail -n 3"
function sx ()
{
echo $(date +%d.%m.%Y\ %H:%M:%S) ____________________________________________________________;
{
read firstLine;
echo "$firstLine";
while read f t s u p; do
let "s2 = $s / 1024";
let "u2 = $u / 1024";
printf '%-40s%-16s%-8s%-8s%-8s\n' $f $t $s2 $u2 $p;
done
} < /proc/swaps
}
function fx ()
{ echo $(date +%d.%m.%Y\ %H:%M:%S) ____________________________________________________________;
/bin/free -m
}
fx|head -n 4;t;sx|tail -n 3
fxsx itself looks like so in the terminal
Code: Select all
root@porteus:/# fxsx
07.09.2022 07:05:02 ____________________________________________________________
total used free shared buff/cache available
Mem: 3873 2208 803 163 862 1072
Swap: 5382 535 4847
________________________________________________________________________________
Filename Type Size Used Priority
/dev/sda6 partition 4607 0 1
/dev/zram0 partition 774 535 100
Code: Select all
logger $(fxsx)
Code: Select all
Sep 7 06:57:12 porteus syslogd[690]: -- MARK --
Sep 7 07:05:12 porteus root: 07.09.2022 07:05:12 ____________________________________________________________ total used free shared buff/cache available Mem: 3873 2212 799 163 862 1068 Swap: 5382 535 4847 ^[[33m^[[1m________________________________________________________________________________^[[m Filename Type Size Used Priority /dev/sda6 partition 4607 0 1 /dev/zram0 partition 774 535 100
Sep 7 07:05:22 porteus ModemManager[1596]: <info> [sleep-monitor] system is about to suspend For clarity, I left the line before and the line after that in as well.