hadoop copytolocal

Works similarly to the get command, except that the destination is restricted to a local file reference
hadoop copytolocal copy file from HDFS to the local file system.
Usage: hadoop fs -copyToLocal [-ignorecrc] [-crc] URI <localdst>
--The -ignorecrc option is used to copy the files that fail the crc check. The -crc option is for copying the files along with their CRC.
  • hadoop fs -copyToLocal /user/hadoop/hadoopdemo/sales salesdemo
  • hdfs dfs -copyToLocal data2.txt data2.copy.txt
If you face any problem in hadoop copytolocal command here is full explaination of copytolacal command
How to copy file from HDFS to the local file system??
  1. bin/hadoop fs -get /hdfs/source/path /localfs/destination/path
  2. bin/hadoop fs -copyToLocal /hdfs/source/path /localfs/destination/path
  3. Point your web browser to HDFS WEBUI(namenode_machine:50070), browse to the file you intend to copy, scroll down the page and click on download the file.

Related Posts