hadoop fs -put command?

0 votes
I had a file in my local system and want to copy it to HDFS. can i use the copy command or Put command? How ?
Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,260 points
15,210 views

10 answers to this question.

+1 vote

Create one directory in HDFS using command “hdfs dfs -mkdir <path>” and then use the given below command to copy data from local file to hdfs: 

Command: hdfs dfs -put /root/Hadoop/sample.txt /"your_hdfs_dir_path" 

Alternatively you can also use the commmand "hdfs dfs -copyFromLocal /root/Hadoop/sample.txt /"your_hdfs_dir_path"

answered Mar 16, 2018 by nitinrawat895
• 10,690 points
0 votes

put and copyFromLocal are very similar with a thin lining in between with copyFromLocal having source restricted to a local file reference.

answered Nov 27, 2018 by Kailash
0 votes
Adding to @Kailash's answer, put can take file from any file system, be it hdfs or local.
answered Nov 27, 2018 by Kangana
0 votes
I think in your case you should be using put. Refer other answers to understand the difference between put and copyFromlocal.
answered Nov 27, 2018 by Neha
0 votes

You can use put command:

hadoop fs -put localpath
answered Dec 7, 2018 by Jacqueline
0 votes
hadoop fs -put <LOCAL_source> ... <HDFS_destination>
answered Dec 7, 2018 by John
0 votes
You can use either command. Both the commands will get your work done.
answered Dec 7, 2018 by Namitha
+1 vote

put syntax:

put <localSrc> <dest>

copy syntax:

copyFromLocal <localSrc> <dest>
answered Dec 7, 2018 by Aditya
given for any eample
0 votes

Both put and copy allow you to copy the file from local system to hdfs

answered Dec 7, 2018 by Preetham
0 votes

copy command can be used to copy files only from local system but put  can be used to copy file from any file system. 

So, you can use either command as both allow copying from local system. 

answered Dec 7, 2018 by Sujay

Related Questions In Big Data Hadoop

+1 vote
2 answers

What does hadoop fs -du command gives as output?

du command is used for to see ...READ MORE

answered Jul 23 in Big Data Hadoop by Lokesh Singh
999 views
0 votes
2 answers

Hadoop fs -stat command

hadoop fs -stat is as hadoop command used ...READ MORE

answered Oct 25, 2018 in Big Data Hadoop by Omkar
• 67,600 points
1,588 views
0 votes
1 answer

The file exists before processing with hadoop command

Took session and it got resolved. READ MORE

answered Dec 18, 2017 in Big Data Hadoop by Sudhir
• 1,610 points
76 views
+2 votes
10 answers

Is there any difference between “hdfs dfs” and “hadoop fs” shell commands?

Yes, there's a difference between hadoop fs and ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Kunal
10,580 views
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,690 points
3,099 views
0 votes
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,260 points
1,128 views
0 votes
1 answer
+1 vote
1 answer

Where to set hadoop.tmp.dir? core-site.xml or hdfs-site.xml?

hadoop.tmp.dir (A base for other temporary directories) is ...READ MORE

answered Mar 26, 2018 in Big Data Hadoop by nitinrawat895
• 10,690 points
1,970 views
0 votes
1 answer

“no such file or directory" in case of hadoop fs -ls

The behaviour that you are seeing is ...READ MORE

answered May 9, 2018 in Big Data Hadoop by nitinrawat895
• 10,690 points

edited May 9, 2018 by nitinrawat895 2,472 views
0 votes
1 answer

How can I download only hdfs and not hadoop?

No, you cannot download HDFS alone because ...READ MORE

answered Mar 15, 2018 in Big Data Hadoop by nitinrawat895
• 10,690 points
90 views