本文共 895 字,大约阅读时间需要 2 分钟。
Just as you can create a folder using mkdir
, you can delete a folder using rmdir
:
就像可以使用mkdir
创建文件夹一样,也可以使用rmdir
删除文件夹:
mkdir fruitsrmdir fruits
You can also delete multiple folders at once:
您也可以一次删除多个文件夹:
mkdir fruits carsrmdir 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环境的任何地方使用
翻译自:
转载地址:http://xtmgb.baihongyu.com/