userimage

What is the difference between -put and -copyFromLocal in hadoop comand

Basically i want to know when we are using the command like

hadoop -fs -put <input path> <output path>

hadoop -fs -copyFromLocal <input path> <output path>

What is the basic difference between -put and -copyFromLocal

userimage

When we are using the hadoop command with -put and -copyFromLocal,Practically there is no difference because if we see the actual backgroud process of the command


hadoop -fs -put <input path> <output path>


Here the hadoop script execute a class "org.apache.hadoop.fs.FsShell" and if we see the code inside the FsShell we can see the code like below


"-put".equals(cmd) || "-copyFromLocal".equals(cmd)


from here we can say that practically there is no difference between both -put and -copyFromLocal.
There may be some logical difference but as per the code there is no difference.

Answer is