无法删除目录

发布于 2024-07-05 01:33:10 字数 251 浏览 11 评论 0原文

我的网络托管(共享)经常出现问题,

我无法删除或更改特定目录的权限。 回复是,

Cannot delete. Directory may not be empty

我检查了权限,看起来没问题。 该文件夹中有 100 个我不想要的文件。

我联系了我的支持人员,他们解决了这个问题,说这是权限问题。 但它又出现了。 有什么建议么?

服务器是Linux。

I am having a frequent problems with my web hosting (its shared)

I am not able to delete or change permission for a particular directory. The response is,

Cannot delete. Directory may not be empty

I checked the permissions and it looks OK. There are 100's of files in this folder which I don't want.

I contacted my support and they solved it saying it was permission issue. But it reappeared. Any suggestions?

The server is Linux.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

記憶穿過時間隧道 2024-07-12 01:33:10

我认为这是来自 FTP 服务器的响应?

通常,来自 FTP 服务器的消息确实意味着这一点。 如果它说该目录不为空,则该目录中可能存在某些您看不到的文件,这些文件可能是以下之一:

  • 您的 PHP/JSP/ASP/任何脚本可能在不同的用户帐户下运行,从而创建您可能不存在的文件能够查看/删除
  • 您的主机的 Web 界面是否在您的 FTP 帐户下运行? 如果您先通过 Web 界面管理某些文件,然后再通过 FTP 管理某些文件,则可能会出现权限冲突。
  • 无意中创建的托管服务器/操作系统文件(例如从托管的 Web 界面)

如果它来自脚本,请编写一个一次性脚本来删除文件和该目录,然后上传并执行它。

需要确定的是,有些 FTP 服务器不支持直接删除目录,您需要先删除所有文件,是这样吗?

I assume that's a response from an FTP server?

Usually, a message from an FTP server really means it. If it says the directory is not empty, there might be certain files you cannot see that exists in the directory which maybe one of:

  • Your PHP/JSP/ASP/whatever scripts may run under a different user account thus creating files which you may not be able to see/delete
  • Is your hosting's web interface run under your FTP account? There might be conflicting permissions there if you manage some files from the web interface and then later via FTP.
  • Hosting server/operating system files created unintentionally e.g. from the hosting's web interface

If it comes from a script, write a one-time throw-away script that delete the files and that directory and then uploads and executes it.

And just to be sure, some FTP server doesn't support direct directory deletion, you need all the files first, is that the case?

北音执念 2024-07-12 01:33:10

这也可能是因为您的 FTP 客户端可能不会显示隐藏文件(例如缓存或您的应用程序可能创建的任何隐藏文件),而隐藏文件会阻止您删除目录。 (不过,在你的情况下,我不确定这是否是原因......这可能是你的托管提供商的权限问题......作为另一个用户(如apache或www)运行的网络服务器与具有全局写入权限的目录相结合) 。

This could also be because your FTP client might not be showing the hidden files (like cache, or any hiddn files that your application might create), while the hidden files are preventing you from deleting the directory. (though, in your case, I am not sure if this is the cause .. .it could be permission issue with your hosting provider.. Webserver running as another user (like apache or www) combined with your directories having global write perms).

别闹i 2024-07-12 01:33:10

您不能 rmdir 包含文件的目录。 您必须首先rm所有文件和子目录。 很多时候,最简单的解决方案是:

$ rm -rf old_directory

某些文件或子目录完全有可能具有权限限制,可能会阻止它们被删除。 有时,这可以通过以下方式解决:

$ chmod -R +w old_directory

但我怀疑这就是您的支持人员之前所做的。

You can't rmdir a directory with files in it. You must first rm all files and subdirectories. Many times, the easiest solution is:

$ rm -rf old_directory

It's entirely possible that some of the files or subdirectories have permission limitations that might prevent them from being removed. Occasionally, this can be solved with:

$ chmod -R +w old_directory

But I suspect that's what your support people did earlier.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文