How to Clear Cache in Linux?

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 

About the Author

Yogi

17 years of experience in various layers of software. Primarily experienced in system side software design and development on server management software. Interested in linux development in x86 and arm architecture.