Linux – commands to clear RAM cache and Swap space.

By | 14/11/2018

The Linux System has three options to clear cache without interrupting any processes or services.
To clear all PageCache, dentries and inodes you need to use something like:

The drop_caches file can be changed by echo command with this numbers: 1,2 and 3.
To clear the Swap space, you may like to run the below command.

You can create one single command to clear RAM Cache and Swap Space, see:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.