Last active
June 2, 2019 22:23
-
-
Save karellism/8f49cffc1e6ba560095832ee2357dffa to your computer and use it in GitHub Desktop.
Clears PageCache and Swap in Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment