clear swap memory linux
sudo swapoff -a; sudo swapon -asudo sync; echo 3 > /proc/sys/vm/drop_caches#!/bin/bash
free_mem="$(free | grep 'Mem:' | awk '{print $7}')"
used_swap="$(free | grep 'Swap:' | awk '{print $3}')"
echo -e "Free memory:\t$free_mem kB ($((free_mem / 1024)) MiB)\nUsed swap:\t$used_swap kB ($((used_swap / 1024)) MiB)"
if [[ $used_swap -eq 0 ]]; then
echo "No swap is in use."
elif [[ $used_swap -lt $free_mem ]]; then
echo "Freeing swap..."
sudo swapoff -a
sudo swapon -a
else
echo "Not enough free memory. Exiting."
exit 1
fi
Also in C++:
- is installed in '/home/agent1409/.local/bin' which is not on PATH
- what is git
- vs code installed extensions list command
- github claims I have a large file that
- git list all global aliases
- uninstall cv2 in pi
- tar czf
- use xargs with sed
- git new branch
- undo git add but keep changes
- how to install protractor
- add submodule
- add platform toolchain to linux
- lsof port
- install newman-reporter-htmlextra
- ubuntu certbot nginx
- git init then how to get url
- github pages with favicon
- get all branches git
- teclado abnt arch linux
- rsync
- systemctl status apache2.service
- make only one digit input box
- linux shard a file into smaller files