The hadoop cp command is for copying the source into the target. The cp command can also be used to copy multiple files into the target. In this case the target should be a directory.
The syntax is shown below:
hadoop fs -cp /user/DPhadoop/SrcFile /user/hadoop/TgtFile
hadoop fs -cp /user/DPhadoop/file1 /user/DPhadoop/file2 hdfs://namenodehost/user/hadoop/TgtDirectory
The syntax is shown below:
hadoop fs -cp /user/DPhadoop/SrcFile /user/hadoop/TgtFile
hadoop fs -cp /user/DPhadoop/file1 /user/DPhadoop/file2 hdfs://namenodehost/user/hadoop/TgtDirectory