

{"id":53943,"date":"2019-04-06T14:41:13","date_gmt":"2019-04-06T09:11:13","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=53943"},"modified":"2019-04-06T14:41:13","modified_gmt":"2019-04-06T09:11:13","slug":"hadoop-getmerge-command","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/","title":{"rendered":"Hadoop getmerge Command &#8211; Learn to Execute it with Example"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:1601,&quot;href&quot;:&quot;https:\\\/\\\/hadoop.apache.org\\\/docs\\\/current\\\/hadoop-project-dist\\\/hadoop-common\\\/FileSystemShell.html&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251001030724\\\/https:\\\/\\\/hadoop.apache.org\\\/docs\\\/current\\\/hadoop-project-dist\\\/hadoop-common\\\/FileSystemShell.html&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-09 12:53:23&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-29 08:55:12&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-04 19:46:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-16 19:55:04&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-29 19:04:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-02 09:08:00&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-19 07:07:54&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-25 13:58:36&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-01 15:24:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-06 17:03:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-10 09:24:57&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-16 05:40:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-20 20:40:08&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-23 22:51:13&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-27 10:20:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-06 13:13:21&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-14 16:05:11&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-10 13:43:00&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-22 08:49:21&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-26 10:18:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-31 03:52:24&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-09 07:07:49&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-09 07:07:49&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p>In this blog, we are going to discuss <strong><a href=\"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-tutorial\/\">Hadoop file system<\/a><\/strong> shell command getmerge. It is used to merge n number of files in the HDFS distributed file system and put it into a single file in local file system. So, let&#8217;s start Hadoop getmerge Command.<\/p>\n<h2>Hadoop\u00a0getmerge\u00a0Command<\/h2>\n<p><strong>Usage:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">hdfs dfs \u2013getmerge [-nl] &lt;src&gt; &lt;localdest&gt;<\/pre>\n<p>Takes the src directory and local destination file as the input. Concatenates the file in the src and puts it into the local destination file. Optionally we can use \u2013nl to add new line character at the end of each file. We can use the \u2013skip-empty-file option to avoid unnecessary new line characters for empty files.<\/p>\n<h3>Example of getmerge command<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">hdfs dfs -getmerge \/user\/dataflair\/dir1\/sample.txt \/user\/dataflair\/dir2\/sample2.txt \/home\/sample1.txt<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/getmerge.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-53944\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/getmerge.png\" alt=\"getmerge command in Hadoop\" width=\"1314\" height=\"168\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/getmerge.png 1314w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/getmerge-150x19.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/getmerge-300x38.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/getmerge-768x98.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/getmerge-1024x131.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/getmerge-520x66.png 520w\" sizes=\"auto, (max-width: 1314px) 100vw, 1314px\" \/><\/a><\/p>\n<p><strong>You Must Explore &#8211;<\/strong> <a href=\"https:\/\/data-flair.training\/blogs\/commands-in-hadoop\/\"><strong>Most Frequently Used Commands in Hadoop<\/strong><\/a><\/p>\n<h2>Why Do We Use Hadoop\u00a0getmerge\u00a0Command?<\/h2>\n<p>The getmerge command in<strong><a href=\"https:\/\/hadoop.apache.org\/docs\/current\/hadoop-project-dist\/hadoop-common\/FileSystemShell.html\"> Hadoop<\/a><\/strong> is for merging files existing in the HDFS file system into a single file in the local file system.<\/p>\n<p>The command is useful to download the output of <a href=\"https:\/\/data-flair.training\/blogs\/map-only-job-in-hadoop-mapreduce\/\"><strong>MapReduce job<\/strong><\/a>. It has multiple part-* files into a single local file. We can use this local file later on for other operations like putting it in excel file for presentation and so on.<\/p>\n<h2>Conclusion<\/h2>\n<p>We conclude that getmerge is a very useful <strong>HDFS file system<\/strong> shell command. In practice, we can use it to merge the output of MapReduce program into a local file.<\/p>\n<p>Still, if you have any confusion regarding\u00a0Hadoop getmerge\u00a0command, ask in the comment section.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we are going to discuss Hadoop file system shell command getmerge. It is used to merge n number of files in the HDFS distributed file system and put it into a&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":53981,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[5231,19487,5342],"class_list":["post-53943","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hadoop","tag-hadoop-commands","tag-hadoop-getmerge-command","tag-hadoop-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Hadoop getmerge Command - Learn to Execute it with Example - DataFlair<\/title>\n<meta name=\"description\" content=\"What is Hadoop getmerge command. Learn how to use getmerge command in Hadoop with example and explore the reason why we are using it\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hadoop getmerge Command - Learn to Execute it with Example - DataFlair\" \/>\n<meta property=\"og:description\" content=\"What is Hadoop getmerge command. Learn how to use getmerge command in Hadoop with example and explore the reason why we are using it\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-06T09:11:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/getmerge-command-in-Hadoop.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Hadoop getmerge Command - Learn to Execute it with Example - DataFlair","description":"What is Hadoop getmerge command. Learn how to use getmerge command in Hadoop with example and explore the reason why we are using it","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/","og_locale":"en_US","og_type":"article","og_title":"Hadoop getmerge Command - Learn to Execute it with Example - DataFlair","og_description":"What is Hadoop getmerge command. Learn how to use getmerge command in Hadoop with example and explore the reason why we are using it","og_url":"https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2019-04-06T09:11:13+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/getmerge-command-in-Hadoop.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"Hadoop getmerge Command &#8211; Learn to Execute it with Example","datePublished":"2019-04-06T09:11:13+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/"},"wordCount":251,"commentCount":2,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/getmerge-command-in-Hadoop.jpg","keywords":["hadoop commands","Hadoop getmerge command","hadoop tutorial"],"articleSection":["Hadoop Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/","url":"https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/","name":"Hadoop getmerge Command - Learn to Execute it with Example - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/getmerge-command-in-Hadoop.jpg","datePublished":"2019-04-06T09:11:13+00:00","description":"What is Hadoop getmerge command. Learn how to use getmerge command in Hadoop with example and explore the reason why we are using it","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/getmerge-command-in-Hadoop.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/getmerge-command-in-Hadoop.jpg","width":1200,"height":628,"caption":"getmerge command in Hadoop"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/hadoop-getmerge-command\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Hadoop Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/hadoop\/"},{"@type":"ListItem","position":3,"name":"Hadoop getmerge Command &#8211; Learn to Execute it with Example"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/53943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=53943"}],"version-history":[{"count":4,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/53943\/revisions"}],"predecessor-version":[{"id":53983,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/53943\/revisions\/53983"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/53981"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=53943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=53943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=53943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}