I saw the following command today posted on a Linux related website:
sudo sh -c “sync; echo 3 > /proc/sys/vm/drop_caches”
While yes, it will clear the memory cache, I question the wisdom of doing this. Linux has really good memory and cache management already, swapping pages in and out as needed. If your system is running low on physical memory it will appropriate memory back from the cache as needed. In 14 years of using Linux I’ve never felt the need to clear the cache.