From bdbb75e083218e11d8c8e34d38e4dc859b444c97 Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Wed, 5 Oct 2016 20:40:22 +0900 Subject: [PATCH] HADOOP-13685. Document -safely option of rm command. Contributed by Xiaoyu Yao. (cherry picked from commit 9a61b52fbefd2970af78bb283ae174d462d57a13) --- .../hadoop-common/src/site/markdown/FileSystemShell.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/src/site/markdown/FileSystemShell.md b/hadoop-common-project/hadoop-common/src/site/markdown/FileSystemShell.md index 0ee3d56022d..1d4174ca8d6 100644 --- a/hadoop-common-project/hadoop-common/src/site/markdown/FileSystemShell.md +++ b/hadoop-common-project/hadoop-common/src/site/markdown/FileSystemShell.md @@ -504,7 +504,7 @@ See [HDFS Snapshots Guide](../hadoop-hdfs/HdfsSnapshots.html). rm ---- -Usage: `hadoop fs -rm [-f] [-r |-R] [-skipTrash] URI [URI ...]` +Usage: `hadoop fs -rm [-f] [-r |-R] [-skipTrash] [-safely] URI [URI ...]` Delete files specified as args. @@ -523,6 +523,7 @@ Options: * The -R option deletes the directory and any content under it recursively. * The -r option is equivalent to -R. * The -skipTrash option will bypass trash, if enabled, and delete the specified file(s) immediately. This can be useful when it is necessary to delete files from an over-quota directory. +* The -safely option will require safety confirmation before deleting directory with total number of files greater than `hadoop.shell.delete.limit.num.files` (in core-site.xml, default: 100). It can be used with -skipTrash to prevent accidental deletion of large directories. Delay is expected when walking over large directory recursively to count the number of files to be deleted before the confirmation. Example: