-put
and -copyFromLocal
are documented as identical, while most examples use the verbose variant -copyFromLocal. Why?
Same thing for
Let's make an example:
If your HDFS contains the path: /tmp/dir/abc.txt
And if your local disk also contains this path then the hdfs API won't know which one you mean, unless you specify a scheme like file://
or hdfs://
. Maybe it picks the path you did not want to copy.
Therefore you have -copyFromLocal
which is preventing you from accidentally copying the wrong file, by limiting the parameter you give to the local filesystem.
Put
is for more advanced users who know which scheme to put in front.
It is always a bit confusing to new Hadoop users which filesystem they are currently in and where their files actually are.