How to remove a entire directory, files and sub directories using mac terminal

June 15, 2009

Terminal Mac

Simply use the following command:

rm -rf /sites/yoursite/http2

This will force remove all files and folders under the toplevel folder you specified so be warned!

You can also use rm -ri which will prompt you at every folder and file.

At the prompts simply enter 'n' for no and 'y' for yes.


About me

Hello! I'm David Heward, how are you going? I'm a Senior Devops/Build Engineer, specialising in AWS & Cloud Automation. Based in London. Strong 10+ year background in Software development. Have a read of my blog. Have a look at some of my working projects. Contact me at @davehewy or on Linkedin.