Difference between hadoop fs -put and hadoop fs -copyFromLocal

snappy picture snappy · Oct 18, 2011 · Viewed 51.6k times · Source

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

Same thing for -get and -copyToLocal

Answer

Ozair Kafray picture Ozair Kafray · Oct 18, 2011
  • copyFromLocal is similar to put command, except that the source is restricted to a local file reference.

So, basically you can do with put, all that you do with copyFromLocal, but not vice-versa.

Similarly,

  • copyToLocal is similar to get command, except that the destination is restricted to a local file reference.

Hence, you can use get instead of copyToLocal, but not the other way round.

Reference: Hadoop's documentation.

Update: For the latest as of Oct 2015, please see this answer below.