【发布时间】:2016-06-13 12:06:07
【问题描述】:
【问题讨论】:
-
我猜它指向某种主文件夹?
【问题讨论】:
来自官方源代码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 / 将列出根目录的直接子目录。
【讨论】:
-ls 在 Hadoop 中的默认位置是用户的主目录,在本例中为 /user/root。
添加/ 使-ls 命令指向文件系统的根目录。
【讨论】:
/ 查找 Hdfs 的根文件夹
【讨论】: