How to Clear CentOS cache data

Solved/Closed
satineeraj
Posts
3
Registration date
Friday August 14, 2020
Status
Member
Last seen
November 26, 2021
- May 28, 2021 at 01:09 PM
HelpiOS
Posts
12528
Registration date
Friday October 30, 2015
Status
Moderator
Last seen
June 24, 2022
- 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 reply

HelpiOS
Posts
12528
Registration date
Friday October 30, 2015
Status
Moderator
Last seen
June 24, 2022
1,794
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