【问题标题】:rm -rf equivalent on Windows batch scriptrm -rf 等效于 Windows 批处理脚本
【发布时间】:2021-03-28 10:39:48
【问题描述】:

我想一次删除多个文件夹和文件,即使某些目录或文件未预设,该命令也不会中断。我还使用通配符(*)来组合文件夹和文件名。

我有以下命令删除Ubuntu中的文件夹

rm -rf dist pkitree srktable cst_sign* cst_encrypt* *.log out

但是,当我尝试在 Windows batch 中做同样的事情时,

rd /s /q dist pkitree srktable cst_sign* cst_encrypt* *.log out 2> NUL

我仍然得到错误状态并且通配符未被识别。有人可以帮助我在 Windows 中实现这种行为吗?

【问题讨论】:

    标签: linux windows bash shell


    【解决方案1】:

    你可以试试:

    powershell -Command "Remove-Item -Recurse dist, *.log"
    

    【讨论】:

      猜你喜欢
      • 2021-10-30
      • 2010-09-11
      • 2012-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-28
      • 1970-01-01
      • 2012-09-28
      相关资源
      最近更新 更多