Hadoop fs -put command

801    Asked by ChloeBurgess in SQL Server , Asked on Jul 27, 2021

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

Answered by Puja Khatri

You can create one directory in HDFS using the commandhdfs 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