Linux Memory

Clear Buffers & Cache

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

If you use sudo:

su -c "sync && echo 3 > /proc/sys/vm/drop_caches"

This one-liner also shows before and after stats:

echo Before: && free -m && echo After: && sync && echo 3 > /proc/sys/vm/drop_caches && free -m