问题标签 [rm]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
10031 浏览

git - git rm 是否删除文件的所有历史记录?

我的项目有一个foo我一直在使用和签入的文件git。我只是做了一些重构,这样我就不再需要这个文件了。如果我这样做git rm foo,该文件是否仍存在于较旧的提交中?我是否能够签出较旧的提交并使用该文件?

0 投票
3 回答
696 浏览

bash - bash 脚本 rm 无法删除由 php mkdir 创建的文件夹

我无法删除由 php mkdir 创建的文件夹

我想删除下/uploads/所有文件和文件夹请帮我谢谢...

0 投票
1 回答
134 浏览

linux - 识别并删除所有 x64 架构文件

我有一个包含许多 i386 和 x64 的 .a 和 .o 库的文件夹 我想查找并删除所有 x64 库?我知道 objdump 可以提供帮助,但我不知道如何使用它(可能使用带有 'find' 或 'sed' 的 bash 脚本)来列出文件并删除它们。

0 投票
4 回答
66304 浏览

git - git - 如何删除空文件夹并推送更改?

如何在本地删除一个空文件夹,并让其他通过 pull-push 共享远程的协作者也发生这种情况?我知道 git 在这个意义上没有“跟踪”文件夹,但问题仍然存在。

例如,我将文件移动到另一个文件夹并提交了(移动的)更改。

但是我不能git rm name得到“不匹配”的文件夹 git rmdir name不存在。

我可以做一个git clean -f folder,但它是如何被推高的?

我可以直接rm删除该文件,但是如何正确删除该目录并将其推送到存储库,然后在其他人拉取时将其发送给其他人,以便删除现有文件夹?

0 投票
6 回答
143482 浏览

bash - How to prevent rm from reporting that a file was not found?

I am using rm within a BASH script to delete many files. Sometimes the files are not present, so it reports many errors. I do not need this message. I have searched the man page for a command to make rm quiet, but the only option I found is -f, which from the description, "ignore nonexistent files, never prompt", seems to be the right choice, but the name does not seem to fit, so I am concerned it might have unintended consequences.

  • Is the -f option the correct way to silence rm? Why isn't it called -q?
  • Does this option do anything else?
0 投票
3 回答
89238 浏览

powershell - Powershell 命令:rm -rf

rm是删除项目,但参数-rf是做什么或表示什么?


每当我输入 help -rf 时,它都会在 powershell 中打印完整的可用命令列表。如果在 powershell 中键入 rm -rf 会发生什么?从阅读中我收集到它会删除驱动器上的所有内容?我不知道?

另外, rm -rf 是否与 rm -rf /

0 投票
1 回答
1298 浏览

c - 无法在 c 程序中删除(rm)文件,但可以在 shell 中

我的 C 程序(在 Linux 上)需要删除一个文件,例如 /home/me/myfile,这是我在程序中的操作方式

运行此程序时,我收到一条消息说权限被拒绝。顺便说一句,ls -al /home/me/myfile退货-rw-r--r--

但是,在同一个用户帐户和同一个 shell 中我执行 C 程序,我可以通过键入简单地删除文件rm -f /home/me/myfile

我在这里错过了什么?

谢谢,

更新:使用remove(/home/me/myfile)or unlink(/home/me/myfile),可以在我的程序中删除该文件。

0 投票
1 回答
288 浏览

rm - 安装 Pow 时出现 rm 错误:“权限被拒绝”

我想安装 Pow。curl get.pow.cx | sh在我的主目录中运行会产生:

在前面添加sudo并没有改变任何东西。

希望这不是一个新手问题,并且与其他人相关。

0 投票
7 回答
295807 浏览

linux - 如何在 Linux 上的 Bash 中一次删除多个文件?

我在 Linux 服务器上有这个文件列表:

我一直在删除选定的日志文件,使用如下命令rm -rf

还有另一种方法,以便我可以立即删除选定的文件吗?

0 投票
3 回答
1173 浏览

linux - Unix命令删除了每个目录,即使没有指定

我对unix很陌生。我运行了以下命令。

以上命令删除了文件夹中的每个目录。

谁能解释我为什么?