为什么hdfs dfs -ls指向与hdfs dfs -ls /不同的位置
从下面可以清楚地看到两个命令的屏幕截图给出了不同的输出:

产生上述产出的主要原因是什么?
发布于 2016-06-13 17:43:20
来自官方源代码org.apache.hadoop.fs.shell.Ls.java。只需搜索DESCRIPTION单词。委员会将列出以下声明:
public static final String DESCRIPTION =
"List the contents that match the specified file pattern. If " +
"path is not specified, the contents of /user/<currentUser> " +
"will be listed. For a directory a list of its direct children " +
"is returned (unless -" + OPTION_DIRECTORY +
" option is specified)" hadoop fs -ls将列出当前用户的主目录内容。
hadoop fs -ls /将列出根目录的直接子程序。
发布于 2016-06-13 12:11:14
-ls在Hadoop中的默认位置是用户的主目录,在本例中是/user/root。
添加/使-ls命令点位于文件系统的根目录。
发布于 2016-06-13 12:22:07
/查找Hdfs的根文件夹。
https://stackoverflow.com/questions/37789428
复制相似问题