English 中文(简体)
FTP 删除非空目录
原标题:FTP Delete non empty directory
  • 时间:2012-05-25 06:26:51
  •  标签:
  • unix
  • ftp

我连接到 Unix 服务器, 我正试图通过 FTP 删除目录 < code> dir , 并删除其中多个文件。 如果我使用的话

ftp> delete dir/*

我得到

550 通配符含糊不清。

当我使用

ftp> prompt off
Interactive mode off.
ftp> mdelete dir/*

我仍然得到

550 通配符含糊不清。

当我尝试

ftp> glob
Globbing on.
ftp> mdelete dir

每一份档案我都会被催问

我怎么能轻易删除/删除/删除目录而不得到每个文件的提示?

最佳回答

我把它分成两步 在一个限制进入的服务器上工作 没有SFTP 只有FTP通过指令线

像这样:

mdelete folder_name/*
rmdir folder_name
问题回答

如果您在服务器上保存隐藏的文件或文件夹( 例如. 文件夹), 您就必须将 Iftp 列表选项设置为“ - a ” 。

因此,这对我有效:

$ lftp -u user,pass server
> set ftp:list-options -a
> cd /folder/to/be/empty/
/folder/to/be/empty/> glob -a rm -r *

使用 Iftp 登录您的服务器, 这将支持 rm -r 命令 。

lftp user, password server

然后:

rm -r directory

-r 表示“递归性”。

信息 :

$ ftp -i... $ ftp -i... $ ftp -i... $ ftp -i... $ ftp -i...

将关闭 mdel 的提示, 这是您想要的。 它无法在 ftp 内完成 。

rmdir 目录Name

但是,此目录必须在当前目录中 。

骗局:http://www.cs.colostate.edu/helpdocs/ftp.html

我使用 Fillezilla, 它会递增删除文件夹 。 我相信 ftp 没有可以递增删除文件夹的命令 。





相关问题
What is the simplest way to create my own FTP server?

What is the simplest way to create my own FTP server in C#? Some of the folders will be virtual folders. The authentication should be from a SQL Server database, which includes tables of the ASP.NET ...

FTP In/Out Folder Name Best Practices

What best practices (if any) do you adhere to regarding setting up outgoing and incoming folders for your FTP clients? We typically use "outgoing" and "incoming", but no matter how you phrase the ...

Using TCPClient with RAW FTP to retrieve file

I get the following message back when trying to retrieve a file using TCPClient and RAW FTP: 425 Failed to establish connection. I connect using : using (TcpClient client = new TcpClient("...

Retrieving a List of Files from an FTP server in C#

I m trying to retrieve a list of files from an FTP server, but I m getting some weird non-ASCII responses. Here is the code that I am using: public string[] getFileList(string mask) { if(!...

FTP error on Quit command

I m using a ftp library that causes an error sending the quit command. It seems that the character before QUIT is not recognized. I took a look at the code but didn t find anything. 500 ?QUIT : ...

Passive FTP Timeout while using WinINet

I m trying to ftp a file using passive ftp but I get a timeout (12002) when the put command is called. I m able to use passive ftp with other ftp sites but not this new one. I ve tried this using ...

热门标签