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,020 points
3,874 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,310 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 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,730 points
6,476 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
• 67,660 points
830 views
0 votes
1 answer

How to execute python script in hadoop file system (hdfs)?

If you are simply looking to distribute ...READ MORE

answered Sep 19, 2018 in Big Data Hadoop by digger
• 26,550 points
2,454 views
0 votes
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,730 points
3,378 views
0 votes
10 answers

hadoop fs -put command?

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

answered Dec 7, 2018 in Big Data Hadoop by Aditya
16,839 views
0 votes
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,260 points
1,230 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,310 points
665 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,310 points
1,986 views