#!/bin/bash echo "it requires at least 3GB free in /tmp" sync echo 3 > /proc/sys/vm/drop_caches dd if=/dev/zero of=/tmp/testfile count=1 bs=999M sysctl -w vm.vfs_cache_pressure=100 echo "Executing find /, that's gonna take a while..." find / > /dev/null echo "OK. Copying huge file..." cp /tmp/testfile /tmp/testfile2 echo "Let's do find / again, checking how much time takes" time find / > /dev/null sysctl -w vm.vfs_cache_pressure=50 echo "Executing find /, that's gonna take a while..." find / > /dev/null echo "OK. Copying huge file..." cp /tmp/testfile2 /tmp/testfile3 echo "Let's do find / again, checking how much time takes (it should be less than before one)" time find / > /dev/null rm -f /tmp/testfile /tmp/testfile2 /tmp/testfile3