Hadoop文件目录中含有‘\’字符的操作问题的解决
[root@bigdata-senior01 ~]# hdfs dfs -ls /
Found 1 items
-rw-r–r-- 3 root 949086 2019-11-27 19:13 /\新建文本文档.txt+root
这时使用hdfs dfs -rm /\新建文本文档.txt+root或者hdfs dfs -rm /\新建文本文档.txt+root都不能删除
解决方法:
[root@bigdata-senior01 ~]# hdfs dfs -rm /’\新建文本文档.txt+root’
Deleted /\新建文本文档.txt+root
[root@bigdata-senior01 ~]#
[root@bigdata-senior01 ~]# hdfs dfs -ls /
Found 1 items
-rw-r–r-- 3 root 949086 2019-11-27 19:13 /\SOPHIE’SWORLD.txt+root
删除方法
[root@bigdata-senior01 ~]# hdfs dfs -rm /’\SOPHIE’’‘SWORLD.txt+root’
Deleted /\SOPHIE’SWORLD.txt+root