rmdir命令

Just as you can create a folder using mkdir, you can delete a folder using rmdir:

就像可以使用mkdir创建文件夹一样,也可以使用rmdir删除文件夹:

mkdir fruits
rmdir fruits

You can also delete multiple folders at once:

您也可以一次删除多个文件夹:

mkdir fruits cars
rmdir fruits cars

The folder you delete must be empty.

您删除的文件夹必须为空。

To delete folders with files in them, we’ll use the more generic rm command which deletes files and folders, using the -rf options:

要删除其中包含文件的文件夹,我们将使用更通用的rm命令,该命令使用-rf选项删除文件和文件夹:

rm -rf fruits cars

Be careful as this command does not ask for confirmation and it will immediately remove anything you ask it to remove.

请小心,因为此命令不会要求您确认,它会立即删除您要求删除的所有内容。

There is no bin when removing files from the command line, and recovering lost files can be hard.

从命令行删除文件时没有bin ,恢复丢失的文件可能很困难。

This command works on Linux, macOS, WSL, and anywhere you have a UNIX environment

此命令可在Linux,macOS,WSL以及您拥有UNIX环境的任何地方使用

翻译自: https://flaviocopes.com/unix-command-rmdir/

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值