15

At the moment I'm using FileZilla to FTP to my website. Sometimes, I want to delete a large directory, full of lots of other sub-directories and files. Filezilla seems to go through them all individually, which means it takes an absolute age to delete!

Is there any way of doing it quickly/er??

Thanks

2
  • "Quickly" and "Deleting lots of files" are two things that don't go together well when using an FTP/SFTP client to delete lots of files on a deep directory structure. Anyone who has to maintain a Magento e-commerce website can testify to this. Jul 20, 2015 at 5:50
  • Use SSH, FTP wasn't designed for this.
    – William
    Jul 20, 2015 at 6:15

7 Answers 7

10

I believe that FTP doesn't actually have a recursive delete operation. The options I can think of are as follows:

  1. Use the ncftp program. This is another FTP program with additional options. However, I think it just works on the command line and doesn't have a GUI.
  2. If you have SSH access to the server then use that instead of FTP and use the rm -r command.
  3. Write a PHP or other script to do the deletion for you.
4
  • The -r option is a recursive delete.
    – iivel
    Mar 19, 2011 at 17:03
  • 3
    ncftp is just another FTP client. It still wouldn't have the ability to delete subdirectories recursively in a single command and would at most do what FileZilla does. Feb 6, 2012 at 6:49
  • You might be able to execute a command through FileZilla, depending on your login.
    – Martijn
    Jul 20, 2015 at 7:32
  • ncftp didn't worked for me Oct 19, 2019 at 19:22
5

Users that don't "ssh" can login to cpanel if their host supports it and use the File Manager there. It will delete files a lot faster. Uploading files over http also seems to be faster in some cases.

1
  • I should have thought of this before. Jan 12, 2018 at 2:40
3

You can quickly delete directory or files from FTP using Windows Explorer.

  1. Open a Windows Explorer window; press Win+E.
  2. Click to select the address bar.
  3. Type the FTP site’s address. (example-ftp://ftp.example.com)
  4. Press Enter.
  5. Input your FTP ID and PWD.
  6. Press Enter.
  7. now you can access all files and directory. Find and delete quickly.

enter image description here

2
  • 1
    This method almost takes the same amount of time as ftp!!
    – bhavya_w
    Jun 18, 2019 at 9:18
  • It opens chrome for me when i hit enter after writing the ip. Nov 23, 2020 at 12:10
2

It's really worth mentioning here that you can rename entire directories instantly and you can rename them into different paths which is usually a good enough solution.

Create a directory called "junk" in the root folder, then drag/move (rename) all directories you want to get rid of into that. Doing this is instant so you can then continue working and in the background let it tick over a manual delete process.

1

cheat: use winscp in ftp mode. it will convert the simple request and complete all the necessary tasks. it's not an ftp "command line", but it's still ftp and can be used with the same ftp credentials to accomplish the task easily (and as quickly as ftp can accomplish it)

1
  • and as quickly as ftp can accomplish it <grin> Jul 20, 2015 at 5:53
1

Here is an easy way to delete files in subfolders without command line. File Zilla :) FileZilla Search

1
  • 1
    Is it faster than simply deleteing the folder? Nov 26, 2017 at 14:47
0

I previously answered a similar question on SO:

https://stackoverflow.com/questions/4387151/how-to-delete-folders-with-wildcard-via-cmd-ftp-windows-server-2008/4445705#4445705

Long story short: You can also remove a directory and all of it's parents with the -p switch [using rmdir]. The -r switch though recursively removes directories given in the arguments path:

http://www.computerhope.com/unix/urm.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy