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…]

 

James

Advertisements

About pcidss

Proficient in IT Controls, IT Security, and Risk management. My recent interests lie in the credit card security and protecting identities. This blog will reflect the past, current, and future best steps to securing data (specifically in the context of PCI DSS, and DSOP)
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:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s