第一次遇到无法删除目录的报错,情形如下。
$ ls
apache-maven-3.6.3 java maven
sudo rm maven
rm: 无法删除'maven': 是一个目录
使用 -r
参数,该参数表示递归删除目录中的文件和目录。
-r, -R, --recursive
remove directories and their contents recursively
附件 文档描述
NAME
rm - remove files or directories
SYNOPSIS
rm [OPTION]... [FILE]...
DESCRIPTION
This manual page documents the GNU version of rm. rm removes each
specified file. By default, it does not remove directories.
If the -I or --interactive=once option is given, and there are more
than three files or the -r, -R, or --recursive are given, then rm
prompts the user for whether to proceed with the entire operation. If
the response is not affirmative, the entire command is aborted.
Otherwise, if a file is unwritable, standard input is a terminal, and