Explore Courses Blog Tutorials Interview Questions
+10 votes
in Big Data Hadoop & Spark by (1.5k points)

I tried moving the files using WinSCP, but it didn’t help. So, I wanna know how can I copy files from HDFS to my local computer file system.

3 Answers

+15 votes
by (13.2k points)

There are two approaches you can use to do the task,

hadoop fs -get <HDFS file path> <Local system directory path>

hadoop fs -copyToLocal <HDFS file path> <Local system directory path>

Another thing you can try and do is simply download it with your web browser.

If you wish to know about Hadoop and Big Data visit this Hadoop Certification.

0 votes
by (106k points)

You can copy the data from hdfs to the local filesystem by following two ways:

  • bin/hadoop fs -get /hdfs/source/path /localfs/destination/path

  •  bin/hadoop fs -copyToLocal /hdfs/source/path /localfs/destination/path

Another alternative way would be:

Download the file from hdfs to the local filesystem. Just, point your web browser to HDFS WEBUI(namenode_machine:50070) and select the file and download it.

0 votes
by (33.1k points)

In Hadoop 2.0,

hdfs dfs -copyToLocal <hdfs_input_file_path> <output_path>

where, the hdfs_input_file_path maybe obtained from http://<<name_node_ip>>:50070/explorer.html and the output_path is that local path, where the file is being copied.

Refer to the following video, regarding Hadoop:

Related questions

Browse Categories