数据上传hadoop操作命令
- 将本地文件上传到Hadoop集群上的指定目录:
hadoop fs -put localfile /hdfs/path
- 将Hadoop集群上的文件下载到本地目录:
hadoop fs -get /hdfs/path localdir
- 查看Hadoop集群上指定目录下的文件列表:
hadoop fs -ls /hdfs/path
- 创建一个新的Hadoop目录:
hadoop fs -mkdir /hdfs/path
- 删除Hadoop集群上的文件或目录:
hadoop fs -rm /hdfs/path/file1
hadoop fs -rm -r /hdfs/path/directory1
- 复制Hadoop集群上的文件或目录到另一个目录:
hadoop fs -cp /hdfs/path/file1 /hdfs/path/backup
hadoop fs -cp /hdfs/path/directory1 /hdfs/path/backup
- 移动Hadoop集群上的文件或目录到另一个目录:
hadoop fs -mv /hdfs/path/file1 /hdfs/path/newdir
hadoop fs -mv /hdfs/path/directory1 /hdfs/path/newdi
原文地址: https://www.cveoy.top/t/topic/hqyW 著作权归作者所有。请勿转载和采集!