What is -cp command in hadoop? How it works?

0 votes
Copying file from one hdfs location to another using -cp command

Command - hadoop fs -cp -p /user/cloudera/data/new.txt /user/cloudera/data1 (Without creating 'data1' directory before using above command)

When -ls command is used to see the file in the directory data1- I do not see the file.

Is it mandatory to create a directory and then copy?
As with the current case explained above I did not get any error.
Oct 17, 2018 in Big Data Hadoop by Neha
• 6,140 points
216 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
/user/cloudera/data1 is not a directory, it is the file that you copied. That is why there is no error.

If you want a directory containing that file, then yes, you need to hadoop fs -mkdir
answered Oct 17, 2018 by Frankie
• 9,590 points

Related Questions In Big Data Hadoop

0 votes
10 answers
0 votes
1 answer

What is the difference in DistCP command and Sqoop command in Hadoop?

Both the distCP (Distributed copy in Hadoop) ...READ MORE

answered Apr 11 in Big Data Hadoop by Gitika
• 8,380 points
18 views
+1 vote
1 answer

Is it necessary to use Zookeeper in Hadoop Stack?

ZooKeeper is a centralized service for maintaining ...READ MORE

answered Mar 27, 2018 in Big Data Hadoop by Ashish
• 2,630 points
63 views
0 votes
1 answer

What Distributed Cache is actually used for in Hadoop?

Basically distributed cache allows you to cache ...READ MORE

answered Apr 2, 2018 in Big Data Hadoop by Ashish
• 2,630 points
76 views
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
• 12,270 points
513 views
0 votes
1 answer

How can I write text in HDFS using CMD?

Hadoop put & appendToFile only reads standard ...READ MORE

answered Apr 27, 2018 in Big Data Hadoop by Shubham
• 12,270 points
41 views
0 votes
1 answer

What is the command to find the free space in HDFS?

You can use dfsadmin which runs a ...READ MORE

answered Apr 29, 2018 in Big Data Hadoop by Shubham
• 12,270 points
78 views
0 votes
1 answer

How to find the used cache in HDFS

hdfs dfsadmin -report This command tells fs ...READ MORE

answered May 4, 2018 in Big Data Hadoop by Shubham
• 12,270 points
119 views
0 votes
1 answer

What is Modeling data in Hadoop and how to do it?

I suggest spending some time with Apache ...READ MORE

answered Sep 19, 2018 in Big Data Hadoop by Frankie
• 9,590 points
39 views
0 votes
1 answer

What is Custom partitioner in Hadoop? How to write partition function ?

Don't think that in Hadoop the same ...READ MORE

answered Sep 18, 2018 in Big Data Hadoop by Frankie
• 9,590 points
79 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.