hadoop fs -put command?

Big Data Hadoop

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 ?

2
Answers

Replies

You will need to first create a directory in the HDFS by using the below command:


hdfs dfs -mkdir <path>


Once done, you can use the below command to copy the data from the local files to HDFS:


 hdfs dfs -put /root/Hadoop/sample.txt /"your_hdfs_dir_path"


You can also use another command alternatively that is represented below:


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

 
 

If you want to unleash your potential in this competitive field, please visit the Big Data Hadoop course page for more information, where you can find the Big Data Hadoop tutorials and Big Data Hadoop frequently asked interview questions and answers as well.

 

This topic has been locked/unapproved. No replies allowed

Login to participate in this discussion.

Leave a reply

Before proceeding, please check your email for a verification link. If you did not receive the email, click here to request another.