Clearing caches from command line

I’m looking for a way to clear caches via the command line (Linux).

I’ve trawled the discussions here, and google a bit and not been able to find anything - I’m hoping someone’s got themselves a nice little script they may share. I started digging through the java docs to write one myself but quickly realised that I’m so out of practice with Java that it’ll be a non-trivial project for me to do that - though it would be interesting & fun little project should I have to go that way - just don’t want to re-invent the wheel.


I don’t think that such a script does exists.

Hi DisabledLeopard,

As CoolCat said such a script doesn’t exist and in order to accomplish what you’re looking to do some Java would most likely be involved. Can explain why you’re wanting to clear the caches? Perhaps there is another solution to your problem that would avoid the issue altogether.



I suppose that perl is installed and using a perl script is also fine for you. You could use as a base and modify the script.