i'm very new in magento2 and i'm following the official docs.

I'm playing around trying to change some css styles in the homepage but i seem to have issues with clearing the static files cache manually.

if i go to the admin panel and go to System > Tools > Cache Management and click Flush Static Files Cache it does work and i can see the changes i made on the website just fine.

But if i want to do it manually by deleting certain files with

"rm -rf var/cache/*"

i get the error

"zsh: no matches found: var/cache/*"

Can anyone please help me understand what's wrong? Why don't i have those directories?

1 Answer 1


You can flush static files with the following command :

rm -rf pub/static/*

Note : Be sure to cd to the magento folder before running this command.

More generally, here is a command to clear all caches, static files, generated classes, ... :

bin/magento c:f && rm -rf pub/static/* var/page_cache/* var/cache/* var/composer_home/* var/view_preprocessed/* generated/code/* generated/metadata/*

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.