How to Clear CentOS cache data

Solved/Closed
satineeraj Posts 4 Registration date Friday August 14, 2020 Status Member Last seen December 17, 2022 - May 28, 2021 at 01:09 PM
HelpiOS Posts 14307 Registration date Friday October 30, 2015 Status Moderator Last seen April 19, 2024 - Jun 5, 2021 at 06:42 PM
I used CentOS so long on my current VPS and not change to another OS. I think there are some big cache files were created there and if that happened, I would like to Clear CentOS Cache Data to free up my storage for my VPS. What is the best way to clear CentOS cache data?

1 response

HelpiOS Posts 14307 Registration date Friday October 30, 2015 Status Moderator Last seen April 19, 2024 1,890
Jun 5, 2021 at 06:42 PM
Hi,

You can use the following commands to clear cache. The Linux system will not be interrupted.
  • Clear PageCache only :

# sync; echo 1 > /proc/sys/vm/drop_caches
  • Clear dentries and inodes :

# sync; echo 2 > /proc/sys/vm/drop_caches
  • Clear PageCache, dentries and inodes :

# sync; echo 3 > /proc/sys/vm/drop_caches
0