hdfs dfs [generic options]
file:///
)、分布式文件系统(hdfs://nn:8020
)等hdfs dfs -ls file:/// #操作本地文件系统
hdfs dfs -ls /
cat /export/servers/hadoop-2.7.4/etc/hadoop/core-site.xml
hdfs dfs -ls hdfs://hadoop01:9000/ #操作HDFS分布式文件系统
hdfs dfs -ls hdfs://hadoop01:9000/
和 hdfs dfs -ls /
访问的是同一个文件系统。hadoop dfs
只能操作HDFS文件系统(包括与Local FS间的操作),不过已经Deprecated(已弃用)hdfs dfs
只能操作HDFS文件系统相关(包括与Local FS间的操作),常用hadoop fs
可操作任意文件系统,不仅仅是hdfs文件系统,使用范围更广.hadoop fs
。当然hdfs dfs
在市面上的使用也比较多。
hadoop fs -help
命令来查看每个命令的详细用法。
Commands Reference
Hadoop 3.2.2
版本命令:https://hadoop.apache.org/docs/r3.2.2/hadoop-project-dist/hadoop-common/FileSystemShell.html