How to concatenate hdfs files and store in output file?

0 votes
I have a directory in hdfs which contains 10 text files. I want to concatenate all these files and store the output in a different file. How can I do this using hadoop command?
Dec 5, 2018 in Big Data Hadoop by digger
• 26,670 points
1,194 views

1 answer to this question.

0 votes

You can use a combination of cat and put command. Something like this:

hadoop fs -cat directory/* | hadoop fs -put - directory/output.txt

answered Dec 5, 2018 by Omkar
• 69,040 points

Related Questions In Big Data Hadoop

0 votes
1 answer

How to create a Hive Database and store it in HDFS?

You will have to exclusively mention the ...READ MORE

answered May 20, 2019 in Big Data Hadoop by Jishnu
194 views
0 votes
1 answer

How to upload file to HDFS in Ubuntu

you can use  hadoop fs -copyFromLocal  "/home/ritwi ...READ MORE

answered Apr 18, 2018 in Big Data Hadoop by kurt_cobain
• 9,310 points
356 views
0 votes
1 answer

How to print the content of a file in console present in HDFS?

Yes, you can use hdfs dfs command ...READ MORE

answered Apr 19, 2018 in Big Data Hadoop by Shubham
• 13,380 points
1,465 views
+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, 2019 in Big Data Hadoop by Lokesh Singh
2,060 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
• 13,380 points
189 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
• 13,380 points
507 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
• 13,380 points
550 views
+1 vote
1 answer

How to read HDFS and local files with the same code in Java?

You can try something like this: ​ ...READ MORE

answered Nov 22, 2018 in Big Data Hadoop by Omkar
• 69,040 points
1,732 views
0 votes
1 answer

How to check the size of a file in Hadoop HDFS?

You can use the  hadoop fs -ls command to ...READ MORE

answered Nov 21, 2018 in Big Data Hadoop by Omkar
• 69,040 points
2,279 views