1.ファイル内に書かれているKEYを元に検索し、削除する
find /var/cache/nginx/example.com -type f -exec grep -l "KEY: http://example.com/$" {} \; | xargs rm -f
この方法であれば、正規表現を使って削除対象を柔軟に指定できます。
例えばhttp://example.com/aaaa/ディレクトリ以下を削除したい場合は
find /var/cache/nginx/example.com -type f -exec grep -l "KEY: http://example.com/aaaa/.*$" {} \; | xargs rm -f
とすれば削除できます。
2.URLからファイルパスを特定し、削除する
echo -n "http://example.com/" | md5sum | awk '{print "/var/cache/nginx/example.com/"substr($1,length($1),1)"/"substr($1,length($1)-2,2)"/"$1}' | xargs rm -f
こちらのページが大変役立ちました。
http://server-setting.info/centos/nginx-cache-remove2.html