How to delete all files in a directory – including subdirectories via FTP

So the moment you are building a new awesome web platform and realize you need to delete the old and forgotten adventures, you’ll need to delete all the files for a clean install.

This is a minor challenge, except deleting all the files in a folder that is not empty can be aggravating without the right command.

I was challenged by this recently, and the fix is easy and elegant.

when you are at the command line (meaning you have typed the command “ftp” <domain name> and logged in you.  You use the command

mdelete *

that is it… be careful it will delete everything in that directory and sub items.  You will get the option to select ynaqn .. which intuitively translates to:

  • y = yes delete
  • n = no don’t!!
  • a = all .. not advised unless you are sure
  • q = quit process
  • p = pass the one item..

That’s it.. happy hacking

[Updated 12/29/2012 .. Ok, so if you KEEP getting the 550 error message you need to get your happy fingers into an SSH session and do it cleanly…]




About J.D.

Passionate about CrossFit, mindset, bettering each other, technology, and the intersection of cybersecurity with products. The online views and posts represent my journey of discovery and learning.
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s