How to Clear CentOS cache data

Report
Posts
2
Registration date
Friday August 14, 2020
Status
Member
Last seen
May 28, 2021
-
Posts
9780
Registration date
Friday October 30, 2015
Status
Moderator
Last seen
June 5, 2021
-
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

Posts
9780
Registration date
Friday October 30, 2015
Status
Moderator
Last seen
June 5, 2021
1,203
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

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!