最佳答案
来自官方源码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/