hadoop copy a local file system folder to HDFS

0 votes

I have a directory present in my local filesystem. That directory is containing multiple directories. I have to copy the whole directory to HDFS.

I am not able to find any command for doing so? Will this command work?

$hadopp fs -copyFromLocal /local-filesystem-directory /HDFS-path
Apr 19, 2018 in Big Data Hadoop by coldcode
• 2,050 points
13,588 views

2 answers to this question.

0 votes

You can use both

hdfs dfs -put /local-filesystem-directory /HDFS-path

or 

hdfs dfs -copyFromLocal /local-filesystem-directory /HDFS-path

They write the data recursively to the HDFS. Hope this helps.

answered Apr 19, 2018 by Shubham
• 13,450 points
0 votes

There's a typo in your command: "hadopp". If you run the command mentioned in your question, you will end up getting an error telling that the command was not found. You can use the following command:

$ hadoop fs -copyFromLocal /local-filesystem-directory /HDFS-path
answered Feb 4, 2019 by Lohith
Oh Damn! Silly typo. Thanks

Related Questions In Big Data Hadoop

0 votes
1 answer

Copy file from HDFS to the local file system

There are two possible ways to copy ...READ MORE

answered Mar 27, 2018 in Big Data Hadoop by nitinrawat895
• 10,950 points
11,337 views
0 votes
1 answer

Hadoop: How to copy directory from local system to hdfs using Java code?

Just use the FileSystem's copyFromLocalFile method. If the source Path ...READ MORE

answered Nov 14, 2018 in Big Data Hadoop by Omkar
• 69,030 points
2,287 views
0 votes
0 answers
0 votes
1 answer

How to copy file from Local file system to HDFS?

Hi@akhtar, You can copy files from your local ...READ MORE

answered 4 days ago in Big Data Hadoop by MD
• 65,880 points
38 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,950 points
6,108 views
+1 vote
11 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyF ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
39,353 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,320 points
2,292 views
0 votes
1 answer
0 votes
1 answer

How to print the content of a file in console present in HDFS?

Yes, you can use hdfs dfs command ...READ MORE

answered Apr 19, 2018 in Big Data Hadoop by Shubham
• 13,450 points
2,052 views
0 votes
1 answer

Where does HDFS stores data on the local file system?

First find the Hadoop directory present in ...READ MORE

answered May 8, 2018 in Big Data Hadoop by Shubham
• 13,450 points
6,808 views