Linux – commands to clear RAM cache and Swap space.

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

The drop_caches file can be changed by echo command with these 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.