hadoop - 'hdfs dfs -ls' 和 'hdfs dfs -ls/' 之间的区别

标签 hadoop hdfs

为什么 hdfs dfs -ls 指向与 hdfs dfs -ls/ 不同的位置?

从下面的截图中可以清楚地看到两个命令给出不同的输出: enter image description here

以上输出的主要原因是什么?

最佳答案

来自官方源码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/ 将列出根目录的直接子目录。

关于hadoop - 'hdfs dfs -ls' 和 'hdfs dfs -ls/' 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37789428/

相关文章:

unix - 我们可以在 linux 中使用 hadoop fsck 命令时跳过文件检查吗?

hadoop - 以安全模式启动的节点

hadoop - 在 Hadoop 2.0 时代,名称节点和数据节点术语是否仍然有效?

html - 如何解析pyspark中的html文件并使用Beautifulsoup?

hadoop - 如何使用 Flume 将事件从运行在 Windows 10 IoT 上的 Raspberry Pi 记录到 HDFS

hadoop - HBASE 导出实用程序创建的序列文件不可读

hadoop - 配置单元多次插入使用DISTINCT select语句出错

java - 从 Java 应用程序中执行 Pig

hadoop - 创建具有固定记录长度的HIVE表

hadoop - HDFS小文件设计