Andrew Fletcher published: 31 August 2022 1 minute read
At first, I attempted
echo 1 > /proc/sys/vm/drop_cachesResponse
-bash: /proc/sys/vm/drop_caches: Permission deniedAdding sudo in front of the command was met with the same result. What about if I execute the shell as root
sudo sh -c 'echo 1 > /proc/sys/vm/drop_caches'Success. Caches cleared.
Different types of clearing cache
Clear PageCache only
sudo sh -c 'echo 1 > /proc/sys/vm/drop_caches'Clear dentries and inodes
sudo sh -c 'echo 2 > /proc/sys/vm/drop_caches'Clear pagecache, dentries, and inodes
sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'