Home > Software > BIGDATA > HADOOP
Interview Questions   Tutorials   Discussions   Programs   Videos   Discussion   

HADOOP - Difference between hadoop fs -put and hadoop fs -copyFromLocal




6264
views
asked marvit March 12, 2015 04:29 AM  

Difference between hadoop fs -put and hadoop fs -copyFromLocal


           

3 Answers



 
answered By Lalapeta77   0  

hadoop fs -put and hadoop fs -copyFromLocal both are same means it'll copy the data from local to hdfs and local copy also available and it's working like copy & paste.

hadoop fs -moveFromLocal command working as cut & paste means it'll move the file from local to hdfs, but local copy is not available.

flag   
   add comment

 
answered By hadoopresources   0  

Both are same intention just copy data from local system to HDFS, most often every Hadoop developer should aware of it.

Put:

Usage: hdfs dfs -put ...

Copy single src, or multiple srcs from local file system to the destination file system. Also reads input from stdin and writes to destination file system.

hdfs dfs -put localfile /user/hadoop/hadoopfile
hdfs dfs -put localfile1 localfile2 /user/hadoop/hadoopdir
hdfs dfs -put localfile hdfs://nn.example.com/hadoop/hadoopfile
hdfs dfs -put - hdfs://nn.example.com/hadoop/hadoopfile Reads the input from stdin.

CopyFromLocal:

Usage: hdfs dfs -copyFromLocal URI

Similar to put command, except that the source is restricted to a local file reference. hdfs dfs -copyFromLocal '/home/venu/Desktop/somethingfile.xml' hdfs://nn.example.com/hadoop/

flag   
   add comment

 
answered By marvit   0  
  • copyFromLocal is similar to put command, except that the source is restricted to a local file reference.
  • copyToLocal is similar to get command, except that the destination is restricted to a local file reference.

From Hadoop's documentation.

flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert