Hadoop fs -put command

600    Asked by AvaBlack in Python , Asked on Apr 16, 2021

I had a file in my local system and want to copy it to HDFS. can i use the copy command or Put command? How ?


Answered by Amelia Arnold

To put hadoo you should try this code:

  You can create one directory in HDFS using the command “hdfs dfs -mkdir ” and, then use the given below command to copy data from the local file to HDFS:
  $ hdfs dfs -put /root/Hadoop/sample.txt /"your_hdfs_dir_path"

Alternatively, you can also use the below command.

  $ hdfs dfs -copyFromLocal /root/Hadoop/sample.txt /"your_hdfs_dir_path


Your Answer

Interviews

Parent Categories