hadoophdfs

Difference between hadoop fs -put and hadoop fs -copyFromLocal


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

Same thing for -get and -copyToLocal


Solution

  • Latest

    There is no difference between -copyFromLocal and the -put command.

    Reference: Hadoop's documentation.


    Earlier

    -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.