“ rm

编程入门 行业动态 更新时间:2024-10-10 11:27:45
本文介绍了“ rm -rf”相当于Windows?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要一种递归删除文件夹及其子级的方法。

I need a way to recursively delete a folder and its children.

是否为此目的使用了预先构建的工具,还是需要编写一个工具?

Is there a prebuilt tool for this, or do I need to write one?

DEL / S 不会删除目录。

DELTREE 已从Windows 2000+中删除

DELTREE was removed from Windows 2000+

推荐答案

RMDIR或RD(如果您是使用经典的命令提示符(cmd.exe):

RMDIR or RD if you are using the classic Command Prompt (cmd.exe):

rd /s /q "path"

RMDIR [/ S] [/ Q] [驱动器:]路径

RMDIR [/S] [/Q] [drive:]path

RD [/ S] [/ Q] [drive:] path

RD [/S] [/Q] [drive:]path

/ S还将删除指定目录中的所有目录和文件到目录本身。 用于删除目录树。

/S Removes all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree.

/ Q安静模式,不要问是否可以使用/ S删除目录树

/Q Quiet mode, do not ask if ok to remove a directory tree with /S

如果使用PowerShell,则可以使用 Remove-Item (别名为 del ,删除, rd , ri , rm 和 rmdir )并进行-递归可以缩写为 -r

If you are using PowerShell you can use Remove-Item (which is aliased to del, erase, rd, ri, rm and rmdir) and takes a -Recurse argument that can be shorted to -r

rd -r "path"

更多推荐

“ rm

本文发布于:2023-11-26 23:44:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1635694.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:rm

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!