0 votes
1 view
in Big Data Hadoop & Spark by (11.5k points)
edited by

-put and -copyFromLocal are documented as identical, while most examples use the verbose variant -copyFromLocal. Why?

1 Answer

0 votes
by (25.6k points)
edited ago by

There is no such big difference between both the commands(-put and -copyFromLocal),

you can either use the -copyFromLocal command or the -put command to move a local file into the distributed file system.

But -put is most robust, since it allows me to copy multiple file paths (files or directories) to HDFS at once, as well as it reads input from stding and writes it directly to HDFS. While on the other hand, copyFromLocal is restricted to a local file reference.

copyFromLocal:

hadoop fs -copyFromLocal <localsrc> URI

Put:

hadoop fs -put [-f] [-p] [-l] [-d] [ - | <localsrc1> .. ]. <dst>

Refer the following video tutorial that will teach you Hadoop from scratch:

 

...