Difference between hadoop fs -put and hadoop fs -copyFromLocal

前端 未结 5 370
一个人的身影
一个人的身影 2020-12-02 15:26

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

Same thing for

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-02 16:08

    Both 'put' & 'copyFromLocal' commands work exactly the same. You cannot use 'put' command to copy files from one hdfs directory to another. Lets see this with an example: say your root has two directories, named 'test1' and 'test2'. If 'test1' contains a file 'customer.txt' and you try copying it to test2 directory
    $ hadoop fs -put /test1/customer.txt /test2 It will result in 'no such file or directory' error since 'put' will look for the file in the local file system and not hdfs. They are both meant to copy files (or directories) from local file system to hdfs, only.

提交回复
热议问题