Hadoop fs -put command
I had a file in my local system and want to copy it to HDFS. can I use the copy command or Hadoop Put command? How?
You can create one directory in HDFS using the command “hdfs dfs -mkdir ” and, then use the given below command to copy data from the local file to HDFS:
$ hdfs dfs -put /root/Hadoop/sample.txt /"your_hdfs_dir_path"
Alternatively, you can also use the below command.
$ hdfs dfs -copyFromLocal /root/Hadoop/sample.txt /"your_hdfs_dir_path