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,240 points
10,229 views

10 answers to this question.

0 votes

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
• 9,990 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
0 votes

put syntax:

put <localSrc> <dest>

copy syntax:

copyFromLocal <localSrc> <dest>
answered Dec 7, 2018 by Aditya
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

0 votes
1 answer

What does hadoop fs -du command gives as output?

The first value is the size of ...READ MORE

answered Apr 27, 2018 in Big Data Hadoop by Shubham
• 13,110 points
624 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,120 points
1,107 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
52 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
8,593 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
• 9,990 points
2,025 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,240 points
750 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
• 9,990 points
1,506 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
• 9,990 points

edited May 9, 2018 by nitinrawat895 1,943 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
• 9,990 points
66 views