Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


Is there any command that by using I can clean the cache in RHEL?

I used this command:

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

but it didn't work.

share|improve this question
define didn't work – warl0ck Dec 15 '12 at 14:30
Means command executed successfully but results didnt changed. Means the Cache Memory remained occupied. – OmiPenguin Dec 15 '12 at 14:34
What's wrong with having something cached? It could speed up access to the cached data. – ott-- Dec 15 '12 at 14:43
What problem are you trying to solve? – jippie Dec 15 '12 at 14:59
There are many reasons why the cache wouldn’t be cleared. If the file is in use or if the cache size is due to tmpfs or ramfs. I have blogged about different possibilities of cache here. – Joe Nov 18 '14 at 15:58
up vote 10 down vote accepted

Try sync; echo 1 > /proc/sys/vm/drop_caches.

share|improve this answer

Depending on what you want to do you can use 1,2 or 3

from https://www.kernel.org/doc/Documentation/sysctl/vm.txt


Writing to this will cause the kernel to drop clean caches, dentries and inodes from memory, causing that memory to become free.

To free pagecache:

echo 1 > /proc/sys/vm/drop_caches

To free dentries and inodes:

echo 2 > /proc/sys/vm/drop_caches

To free pagecache, dentries and inodes:

echo 3 > /proc/sys/vm/drop_caches

As this is a non-destructive operation and dirty objects are not freeable, the user should run 'sync' first.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.