In relation to this:
https://unix.stackexchange.com/a/754252/582781
Solution 1:
free -g -s2 | sed -u -n 's/^Mem:\s\+[0-9]\+\s\+\([0-9]\+\)\s.\+/\1/p' >> memory.log
Is there a way to add Swap to this, so that I would log the sum of used Mem and Swap?