1. 将本地文件上传到Hadoop集群上的指定目录:

hadoop fs -put localfile /hdfs/path

  1. 将Hadoop集群上的文件下载到本地目录:

hadoop fs -get /hdfs/path localdir

  1. 查看Hadoop集群上指定目录下的文件列表:

hadoop fs -ls /hdfs/path

  1. 创建一个新的Hadoop目录:

hadoop fs -mkdir /hdfs/path

  1. 删除Hadoop集群上的文件或目录:

hadoop fs -rm /hdfs/path/file1

hadoop fs -rm -r /hdfs/path/directory1

  1. 复制Hadoop集群上的文件或目录到另一个目录:

hadoop fs -cp /hdfs/path/file1 /hdfs/path/backup

hadoop fs -cp /hdfs/path/directory1 /hdfs/path/backup

  1. 移动Hadoop集群上的文件或目录到另一个目录:

hadoop fs -mv /hdfs/path/file1 /hdfs/path/newdir

hadoop fs -mv /hdfs/path/directory1 /hdfs/path/newdi

数据上传hadoop操作命令

原文地址: https://www.cveoy.top/t/topic/hqyW 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录