{"id":859,"date":"2015-04-18T17:34:30","date_gmt":"2015-04-18T17:34:30","guid":{"rendered":"http:\/\/codethataint.com\/blog\/?p=859"},"modified":"2016-07-20T04:26:50","modified_gmt":"2016-07-20T04:26:50","slug":"hadoop-terminal-commands","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/hadoop-terminal-commands\/","title":{"rendered":"Hadoop Terminal Commands"},"content":{"rendered":"<p><strong>View list of Hadoop Files<\/strong><\/p>\n<pre>\r\n>>hadoop fs -ls ..\r\n<\/pre>\n<p><strong>Creating new Folder<\/strong><\/p>\n<pre>\r\n>>hadoop fs -mkdir test\r\n<\/pre>\n<p>The above created file can be viewed in Hue<\/p>\n<p><strong>Adding Files to Hadoop File System<\/strong><\/p>\n<pre>\r\n>>hadoop fs -put Test.txt test\r\n<\/pre>\n<p>Incase files need to be copied from more than one Directory use put command as Below<\/p>\n<pre>\r\n>>hadoop fs -put Test1 Test2 Test\r\n<\/pre>\n<p><strong>Getting Files to Hadoop File System<\/strong><\/p>\n<pre>\r\n>>hadoop fs -get Test.txt Test1\r\n<\/pre>\n<p><strong>Deleting a File from Hadoop File System<\/strong><\/p>\n<pre>\r\n>>hadoop fs -rm Test1\/Test.txt\r\n<\/pre>\n<p>In the above case the file will be moved to the Trash<\/p>\n<p><strong>Deleting a File from Hadoop File System<\/strong><\/p>\n<pre>\r\n>>hadoop fs -rm -skipTrash Test1\/Test.txt\r\n<\/pre>\n<p><strong>Deleting a File-  Recursive Remove<\/strong><\/p>\n<pre>\r\n>>hadoop fs -rmr -skipTrash Test1\r\n<\/pre>\n<p><strong>View part of Data file<\/strong><\/p>\n<pre>\r\n>> hadoop fs -cat \/user\/training\/shakespeare.txt | tail -n5\r\n<\/pre>\n<p><strong>Hadoop &#8211; Map Reduce<\/strong><\/p>\n<pre>\r\n>> hadoop jar Test.jar T1 output\r\n<\/pre>\n<p><em>hadoop jar MapReduce.jar InputFile OutputFolder<\/em><\/p>\n<p><strong>Start hdfs daemons<\/strong><\/p>\n<pre>\r\n>>  start-dfs.sh\r\n<\/pre>\n<p><strong>Start MapReduce daemons:<\/strong><\/p>\n<pre>\r\n>>  start-yarn.sh\r\n<\/pre>\n<p><strong>Verify Hadoop daemons:<\/strong><\/p>\n<pre>\r\n>>  jps\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>View list of Hadoop Files >>hadoop fs -ls .. Creating new Folder >>hadoop fs -mkdir test The above created file can be viewed in Hue Adding Files to Hadoop File System >>hadoop fs -put Test.txt test Incase files need to be copied from more than one Directory use put command as Below >>hadoop fs -put&hellip; <a href=\"https:\/\/codethataint.com\/blog\/hadoop-terminal-commands\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[152,151],"tags":[],"class_list":["post-859","post","type-post","status-publish","format-standard","hentry","category-commands-hadoop","category-hadoop"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=859"}],"version-history":[{"count":13,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/859\/revisions"}],"predecessor-version":[{"id":1382,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/859\/revisions\/1382"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}