Clear PageCache and Swap in Linux
#!/bin/bash # echo 1 = clear pagecache, echo 2 clears dentries and inodes, echo 3 clear Pagecache, dentries and inodes su -c "echo 3 >'/proc/sys/vm/drop_caches' && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'" root
Comments