

{"id":446,"date":"2016-06-13T14:58:07","date_gmt":"2016-06-13T09:28:07","guid":{"rendered":"http:\/\/data-flair.training\/blogs\/?p=446"},"modified":"2021-08-25T22:34:00","modified_gmt":"2021-08-25T17:04:00","slug":"hadoop-hdfs-commands","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-commands\/","title":{"rendered":"Hadoop HDFS Commands with Examples and Usage"},"content":{"rendered":"<p>In this Hadoop HDFS Commands tutorial, we are going to learn the remaining important and frequently used Hadoop commands with the help of which we will be able to perform HDFS file operations like moving a file, deleting a file, changing files permissions, setting replication factor, changing files ownership, etc.<\/p>\n<h2>Hadoop HDFS Commands<\/h2>\n<p>Hadoop file system shell commands are used to perform various operations on Hadoop HDFS. In this article, frequently used Hadoop File System Shell commands are discussed with their example and usage. All the Hadoop basic commands are invoked by the bin\/hdfs script.<\/p>\n<p>If you face any doubt in Hadoop HDFS Commands, Please Ask us in comments.<\/p>\n<p>Let us now start with the HDFS commands.<\/p>\n<h3><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/hadoop-hdfs-commands.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75546\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/hadoop-hdfs-commands.jpg\" alt=\"hdfs commands\" width=\"802\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/hadoop-hdfs-commands.jpg 802w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/hadoop-hdfs-commands-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/hadoop-hdfs-commands-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/hadoop-hdfs-commands-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/hadoop-hdfs-commands-520x272.jpg 520w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/a><\/h3>\n<h3>1. moveFromLocal<\/h3>\n<p><b>HDFS moveFromLocal Command Usage:<\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">hadoop fs -moveFromLocal &lt;localsrc&gt; &lt;dest&gt;<\/pre>\n<p><b>HDFS moveFromLocal Command Example:<\/b><\/p>\n<p>Here we are trying to move the file \u2018test1\u2019 from the local filesystem to the Hadoop filesystem.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/moveFromLocalcommand-HDFScommands46.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75522\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/moveFromLocalcommand-HDFScommands46.png\" alt=\"moveFromLocal HDFS commands\" width=\"1299\" height=\"225\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/moveFromLocalcommand-HDFScommands46.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/moveFromLocalcommand-HDFScommands46-150x26.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/moveFromLocalcommand-HDFScommands46-300x52.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/moveFromLocalcommand-HDFScommands46-768x133.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/moveFromLocalcommand-HDFScommands46-1024x177.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/moveFromLocalcommand-HDFScommands46-520x90.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforfilemovefromlocal-HDFScommands47.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75523\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforfilemovefromlocal-HDFScommands47.png\" alt=\"checking for file movefromlocal - HDFS commands\" width=\"1299\" height=\"338\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforfilemovefromlocal-HDFScommands47.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforfilemovefromlocal-HDFScommands47-150x39.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforfilemovefromlocal-HDFScommands47-300x78.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforfilemovefromlocal-HDFScommands47-768x200.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforfilemovefromlocal-HDFScommands47-1024x266.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforfilemovefromlocal-HDFScommands47-520x135.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400\">The file from the local gets deleted.<\/span><\/p>\n<p><b>HDFS moveFromLocal Command Description:<\/b><\/p>\n<p>The Hadoop fs shell command <strong>moveFromLocal<\/strong> moves the file or directory from the local filesystem to the destination in Hadoop HDFS.<\/p>\n<h3>2. moveToLocal<\/h3>\n<p><b>HDFS moveToLocal Command Usage:<\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">hadoop fs -moveToLocal &lt;src&gt; &lt;localdest&gt;<\/pre>\n<p><b>HDFS moveToLocal Command Example:<\/b><\/p>\n<p><span style=\"color: #ff0000\">This command is not yet implemented.<\/span><\/p>\n<p><b>HDFS moveToLocal Command Description:<\/b><\/p>\n<p>The Hadoop fs shell command <strong>moveToLocal<\/strong> moves the file or directory from the Hadoop filesystem to the destination in the local filesystem.<\/p>\n<h3>3. tail<\/h3>\n<p><b>HDFS tail Command Usage:<\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">hadoop fs -tail [-f] &lt;file&gt;<\/pre>\n<p><b>HDFS tail Command Example:<\/b><\/p>\n<p>Here using the <strong>tail<\/strong> command, we are trying to display the 1KB of file \u2018test\u2019 present in the dataflair directory on the HDFS filesystem.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/tailcommand-HDFScommands32.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75525\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/tailcommand-HDFScommands32.png\" alt=\"tail command - HDFS commands\" width=\"1299\" height=\"545\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/tailcommand-HDFScommands32.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/tailcommand-HDFScommands32-150x63.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/tailcommand-HDFScommands32-300x126.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/tailcommand-HDFScommands32-768x322.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/tailcommand-HDFScommands32-1024x430.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/tailcommand-HDFScommands32-520x218.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/tailwith-fcommand-HDFScommands33.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75526\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/tailwith-fcommand-HDFScommands33.png\" alt=\"tail with fcommand-HDFS commands\" width=\"1299\" height=\"548\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/tailwith-fcommand-HDFScommands33.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/tailwith-fcommand-HDFScommands33-150x63.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/tailwith-fcommand-HDFScommands33-300x127.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/tailwith-fcommand-HDFScommands33-768x324.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/tailwith-fcommand-HDFScommands33-1024x432.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/tailwith-fcommand-HDFScommands33-520x219.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p><b>HDFS tail Commnad Description:<\/b><\/p>\n<p>The Hadoop fs shell <strong>tail<\/strong> command shows the last 1KB of a file on console or stdout.<\/p>\n<p>The <strong>-f<\/strong> shows the append data as the file grows.<\/p>\n<p>If you missed\u00a0<strong><a href=\"https:\/\/data-flair.training\/blogs\/top-hadoop-hdfs-commands-tutorial\/\">Top 10 Hadoop Hdfs Commands<\/a><\/strong>\u00a0in Part-II then practice them as well.<\/p>\n<h3>4. rm<\/h3>\n<p><b>HDFS rm Command Usage:<\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">hadoop fs \u2013rm &lt;path&gt;<\/pre>\n<p><b>HDFS rm Command Example:<\/b><\/p>\n<p>The below example deletes the file \u2018new\u2019 using <strong>rm<\/strong> command.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/rmcommand-HDFScommands20.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75527\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/rmcommand-HDFScommands20.png\" alt=\"rm command - HDFS commands\" width=\"1299\" height=\"309\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/rmcommand-HDFScommands20.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/rmcommand-HDFScommands20-150x36.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/rmcommand-HDFScommands20-300x71.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/rmcommand-HDFScommands20-768x183.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/rmcommand-HDFScommands20-1024x244.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/rmcommand-HDFScommands20-520x124.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p>Here in the below example we are recursively deleting the DataFlair directory using -r with rm command.<\/p>\n<p><b>HDFS rm Command Description:<\/b><\/p>\n<p><span style=\"font-weight: 400\">The<\/span><b> rm<\/b><span style=\"font-weight: 400\"> command removes the file present in the specified path.<\/span><\/p>\n<p><b>HDFS rm Command Example:<\/b><\/p>\n<p>Here in the below example we are recursively deleting the DataFlair directory using -r with rm command.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/findcommand-HDFScommands49.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75531\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/findcommand-HDFScommands49.png\" alt=\"find command - HDFS commands\" width=\"1299\" height=\"157\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/findcommand-HDFScommands49.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/findcommand-HDFScommands49-150x18.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/findcommand-HDFScommands49-300x36.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/findcommand-HDFScommands49-768x93.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/findcommand-HDFScommands49-1024x124.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/findcommand-HDFScommands49-520x63.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p><b>HDFS rm Command Description:<\/b><br \/>\nRecursive version of delete.<\/p>\n<h3>5. expunge<\/h3>\n<p><b>HDFS expunge Command Usage:<\/b><br \/>\n<b><\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">hadoop fs -expunge<\/pre>\n<p><b>HDFS expunge Command Example:<\/b><br \/>\n<b><\/b><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/expungecommand-HDFScommands23.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75530\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/expungecommand-HDFScommands23.png\" alt=\"expunge command - HDFS commands\" width=\"1299\" height=\"129\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/expungecommand-HDFScommands23.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/expungecommand-HDFScommands23-150x15.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/expungecommand-HDFScommands23-300x30.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/expungecommand-HDFScommands23-768x76.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/expungecommand-HDFScommands23-1024x102.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/expungecommand-HDFScommands23-520x52.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p><b>HDFS expunge Command Description:<\/b><br \/>\nHDFS expunge command makes the trash empty.<\/p>\n<p class=\"entry-title\">Learn few more frequently used\u00a0<strong><a href=\"https:\/\/data-flair.training\/blogs\/hdfs-hadoop-commands\/\">Hadoop Commands with Examples and Usage<\/a>\u00a0<\/strong>in\u00a0Part-III.<\/p>\n<h3>6. chown<\/h3>\n<p><b>HDFS chown Command Usage:<\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">hadoop fs -chown [-R] [owner] [:[group]] &lt;path&gt;<\/pre>\n<p><b>HDFS chown Command Example:<\/b><br \/>\nHere we are changing the owner of a file name sample using the <strong>chown<\/strong> command.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chowncommand-HDFScommands42.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75534\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chowncommand-HDFScommands42.png\" alt=\"chown command - HDFS commands\" width=\"1299\" height=\"311\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chowncommand-HDFScommands42.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chowncommand-HDFScommands42-150x36.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chowncommand-HDFScommands42-300x72.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chowncommand-HDFScommands42-768x184.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chowncommand-HDFScommands42-1024x245.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chowncommand-HDFScommands42-520x124.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforowner-HDFScommands43.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75535\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforowner-HDFScommands43.png\" alt=\"checking for owner - HDFScommands\" width=\"1299\" height=\"491\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforowner-HDFScommands43.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforowner-HDFScommands43-150x57.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforowner-HDFScommands43-300x113.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforowner-HDFScommands43-768x290.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforowner-HDFScommands43-1024x387.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforowner-HDFScommands43-520x197.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p><b>HDFS chown Command Description:<\/b><\/p>\n<p>The Hadoop fs shell command <strong>chown<\/strong> changes the owner of the file.<\/p>\n<p>The <strong>-R<\/strong> option recursively changes files permissions through the directory structure. The user must be the owner of the file or superuser.<\/p>\n<p>To learn more about the world&#8217;s most reliable storage layer <strong><a href=\"http:\/\/data-flair.training\/blogs\/introduction-tutorial-hdfs\/\" target=\"_blank\" rel=\"noopener noreferrer\">follow this HDFS introductory guide<\/a><\/strong>.<\/p>\n<h3>7. chgrp<\/h3>\n<p><b>HDFS chgrp Command Usage:<\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">hadoop fs -chgrp &lt;group&gt; &lt;path&gt;<\/pre>\n<p><b>HDFS chgrp Command Example:<\/b><\/p>\n<p>In the below example, we are changing the group of \u2018sample.zip\u2019 file of the HDFS file system.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chgrpcommand-HDFScommands37.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75539\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chgrpcommand-HDFScommands37.png\" alt=\"chgrp command - HDFS commands\" width=\"1299\" height=\"295\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chgrpcommand-HDFScommands37.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chgrpcommand-HDFScommands37-150x34.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chgrpcommand-HDFScommands37-300x68.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chgrpcommand-HDFScommands37-768x174.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chgrpcommand-HDFScommands37-1024x233.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chgrpcommand-HDFScommands37-520x118.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforgroup-HDFScommands38.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75540\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforgroup-HDFScommands38.png\" alt=\"checkingforgroup - HDFScommands\" width=\"1299\" height=\"445\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforgroup-HDFScommands38.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforgroup-HDFScommands38-150x51.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforgroup-HDFScommands38-300x103.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforgroup-HDFScommands38-768x263.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforgroup-HDFScommands38-1024x351.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/checkingforgroup-HDFScommands38-520x178.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p>Use<strong> -R<\/strong> option to change recursively through the directory structure.<\/p>\n<p>Here we are trying to change the group of all files present in the DataFlair directory on the HDFS filesystem.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chrgpwith-Rcommand-HDFScommands39.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75538\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chrgpwith-Rcommand-HDFScommands39.png\" alt=\"chrgp with Rcommand - HDFS commands\" width=\"1299\" height=\"438\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chrgpwith-Rcommand-HDFScommands39.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chrgpwith-Rcommand-HDFScommands39-150x51.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chrgpwith-Rcommand-HDFScommands39-300x101.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chrgpwith-Rcommand-HDFScommands39-768x259.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chrgpwith-Rcommand-HDFScommands39-1024x345.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/chrgpwith-Rcommand-HDFScommands39-520x175.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p><b>HDFS chgrp Description:<\/b><\/p>\n<p>The Hadoop fs shell command <strong>chgrp<\/strong> changes the group of the file specified in the path.<\/p>\n<p>The user must be the owner of the file or superuser.<\/p>\n<h3>8. setrep<\/h3>\n<p><b>HDFS setrep Command Usage:<\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">hadoop fs -setrep &lt;rep&gt; &lt;path&gt;<\/pre>\n<p><b>HDFS setrep Command Example:<\/b><\/p>\n<p>Here we are trying to change the replication factor of the \u2018sample\u2019 file present in newDataFlair directory on the HDFS filesystem.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/setrepcommand-HDFScommands28.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75541\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/setrepcommand-HDFScommands28.png\" alt=\"setrep command - HDFScommands\" width=\"1299\" height=\"156\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/setrepcommand-HDFScommands28.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/setrepcommand-HDFScommands28-150x18.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/setrepcommand-HDFScommands28-300x36.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/setrepcommand-HDFScommands28-768x92.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/setrepcommand-HDFScommands28-1024x123.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/setrepcommand-HDFScommands28-520x62.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p>Here we are trying to change the replication factor of all files residing in the newDataFlair directory.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/setrepcommand-HDFScommands29.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75542\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/setrepcommand-HDFScommands29.png\" alt=\"setrep command - HDFS commands\" width=\"1299\" height=\"207\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/setrepcommand-HDFScommands29.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/setrepcommand-HDFScommands29-150x24.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/setrepcommand-HDFScommands29-300x48.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/setrepcommand-HDFScommands29-768x122.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/setrepcommand-HDFScommands29-1024x163.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/setrepcommand-HDFScommands29-520x83.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p><b>HDFS setrep Command Description:<\/b><\/p>\n<p><strong>setrep<\/strong> command changes the replication factor to a specific count instead of the default replication factor for the file specified in the path. If used for a directory, then it will recursively change the replication factor for all the files residing in the directory.<\/p>\n<h3>9. du<\/h3>\n<p><b>HDFS du Command Usage:<\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">hadoop fs \u2013du \u2013s \/directory\/filename<\/pre>\n<p><b>HDFS du Command Example:<\/b><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/ducommand-HDFScommands9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75543\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/ducommand-HDFScommands9.png\" alt=\"du command - HDFS commands\" width=\"1299\" height=\"151\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/ducommand-HDFScommands9.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/ducommand-HDFScommands9-150x17.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/ducommand-HDFScommands9-300x35.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/ducommand-HDFScommands9-768x89.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/ducommand-HDFScommands9-1024x119.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/ducommand-HDFScommands9-520x60.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p>Here we are checking the size of file \u2018file1\u2019 in newDataFlair directory of HDFS.<\/p>\n<p><b>HDFS du Description:<\/b><\/p>\n<p>This Hadoop fs shell command <a href=\"https:\/\/hadoop.apache.org\/docs\/r2.4.1\/hadoop-project-dist\/hadoop-common\/FileSystemShell.html#du\">du<\/a> prints a summary of the amount of disk usage of all files\/directories in the path.<\/p>\n<h3>10. df<\/h3>\n<p><b>HDFS df Command Usage:<\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">hadoop fs -df [-h] &lt;path&gt;<\/pre>\n<p><b>HDFS df Command Example:<\/b><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/dfcommand-HDFScommands35.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75544\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/dfcommand-HDFScommands35.png\" alt=\"df command - HDFS commands\" width=\"1299\" height=\"255\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/dfcommand-HDFScommands35.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/dfcommand-HDFScommands35-150x29.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/dfcommand-HDFScommands35-300x59.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/dfcommand-HDFScommands35-768x151.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/dfcommand-HDFScommands35-1024x201.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/dfcommand-HDFScommands35-520x102.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p><b>HDFS df Command Description:<\/b><\/p>\n<p>The Hadoop fs shell command <strong>df<\/strong> shows the capacity, size, and free space available on the HDFS file system.<\/p>\n<p>The <strong>-h<\/strong> option formats the file size in the human-readable format.<\/p>\n<h3>11. fsck<\/h3>\n<p><b>HDFS\u00a0<strong>fsck<\/strong> Command Usage:<\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">hadoop fsck &lt;path&gt; [ -move | -delete | -openforwrite] [-files [-blocks [-locations | -racks]]]<\/pre>\n<p><b>HDFS\u00a0<strong>fsck<\/strong> Command Example:<\/b><\/p>\n<p>In this example, we are trying to check the health of the files in \u2018dataflair\u2019 directory present in HDFS using the fsck command.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/06\/52.fsckcommand-HDFScommands.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75821\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/06\/52.fsckcommand-HDFScommands.png\" alt=\"fsck command - HDFS commands\" width=\"1299\" height=\"125\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/06\/52.fsckcommand-HDFScommands.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/06\/52.fsckcommand-HDFScommands-150x14.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/06\/52.fsckcommand-HDFScommands-300x29.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/06\/52.fsckcommand-HDFScommands-768x74.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/06\/52.fsckcommand-HDFScommands-1024x99.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/06\/52.fsckcommand-HDFScommands-520x50.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/06\/53.fsckcommandoutput-HDFScommands.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-75822 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/06\/53.fsckcommandoutput-HDFScommands.png\" alt=\"fsck command output - HDFS commands\" width=\"1299\" height=\"741\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/06\/53.fsckcommandoutput-HDFScommands.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/06\/53.fsckcommandoutput-HDFScommands-150x86.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/06\/53.fsckcommandoutput-HDFScommands-300x171.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/06\/53.fsckcommandoutput-HDFScommands-768x438.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/06\/53.fsckcommandoutput-HDFScommands-1024x584.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/06\/53.fsckcommandoutput-HDFScommands-520x297.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p><b>HDFS\u00a0<strong>fsck<\/strong> Command Description:<\/b><\/p>\n<p>The <strong>fsck<\/strong> Hadoop command is used to check the health of the HDFS.<\/p>\n<table class=\"df-table-center\">\n<tbody>\n<tr>\n<td><b>Options<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>&lt;path&gt;<\/b><\/td>\n<td><span style=\"font-weight: 400\">start checking from the path specified here<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>-move<\/b><\/td>\n<td><span style=\"font-weight: 400\">It moves a corrupted file to the lost+found directory.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>-delete<\/b><\/td>\n<td><span style=\"font-weight: 400\">It deletes the corrupted files present in HDFS.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>-openforwrite<\/b><\/td>\n<td><span style=\"font-weight: 400\">It prints the files which are opened for write<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>-files<\/b><\/td>\n<td><span style=\"font-weight: 400\">It prints the files being checked.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>-blocks<\/b><\/td>\n<td><span style=\"font-weight: 400\">It prints out all the blocks of the file while checking.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>-locations<\/b><\/td>\n<td><span style=\"font-weight: 400\">It prints the location of all the blocks of files while checking.<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>-racks<\/b><\/td>\n<td><span style=\"font-weight: 400\">It displays the network topology for DataNode locations.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>What\u2019s Next<\/h2>\n<p>Play with few more\u00a0<strong><a href=\"http:\/\/data-flair.training\/blogs\/play-with-hadoop-hdfs-using-commands-tutorial\/\">HDFS Commands in Part-III<\/a>\u00a0<\/strong>and\u00a0know everything to perform operations on HDFS files\/directories.<\/p>\n<p>If you find this Hadoop HDFS commands helpful or if you have any queries let us know in the comments and our support team will get back to you.<\/p>\n<p>Hope You like the Hadoop HDFS Commands Tutorial.<\/p>\n<p>Keep Executing!!<span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:2469,&quot;href&quot;:&quot;https:\\\/\\\/hadoop.apache.org\\\/docs\\\/r2.4.1\\\/hadoop-project-dist\\\/hadoop-common\\\/FileSystemShell.html#du&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20250808135905\\\/https:\\\/\\\/hadoop.apache.org\\\/docs\\\/r2.4.1\\\/hadoop-project-dist\\\/hadoop-common\\\/FileSystemShell.html&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-11 06:56:41&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-16 05:44:01&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-23 12:23:50&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-29 06:59:05&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-02 11:49:05&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-08 06:57:03&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-15 20:39:13&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-19 07:01:33&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-23 07:48:05&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-27 17:41:15&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-03 07:55:19&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-08 01:07:50&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-11 09:35:49&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-16 16:42:28&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-20 11:59:20&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-24 08:37:17&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-02 14:06:10&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-07 08:04:20&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-11 15:24:15&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-19 17:04:31&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-23 19:14:53&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-27 01:32:32&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-31 15:34:11&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-13 09:52:15&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-17 05:47:52&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-26 09:44:47&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-01 08:12:46&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-06 12:44:57&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-11 12:18:16&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-18 04:05:03&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-01 07:12:13&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-04 14:16:56&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-12 07:46:28&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-16 02:54:11&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-21 13:13:10&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-25 12:57:50&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-29 00:02:16&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-07-02 08:29:15&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-07-06 09:58:49&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-07-10 03:10:01&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-07-14 09:20:56&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-07-17 11:10:58&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-07-17 11:10:58&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this Hadoop HDFS Commands tutorial, we are going to learn the remaining important and frequently used Hadoop commands with the help of which we will be able to perform HDFS file operations like&#46;&#46;&#46;<\/p>\n","protected":false},"author":7,"featured_media":75546,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[1907,21828,5554,5555,21831,21830,21827,21826,21829,21825],"class_list":["post-446","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hdfs","tag-big-data","tag-hdfs-chown","tag-hdfs-command-list","tag-hdfs-commands","tag-hdfs-df","tag-hdfs-du","tag-hdfs-expunge","tag-hdfs-rm","tag-hdfs-setrep","tag-hdfs-tail"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Hadoop HDFS Commands with Examples and Usage - DataFlair<\/title>\n<meta name=\"description\" content=\"Explore HDFS commands like moveFromLocal, rm, chgrp, du, df, tail to perform operations like moving a file, changing group of a file, with example, usage &amp; description.\" \/>\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-hdfs-commands\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hadoop HDFS Commands with Examples and Usage - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Explore HDFS commands like moveFromLocal, rm, chgrp, du, df, tail to perform operations like moving a file, changing group of a file, with example, usage &amp; description.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-commands\/\" \/>\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=\"2016-06-13T09:28:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-25T17:04:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/hadoop-hdfs-commands.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\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=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Hadoop HDFS Commands with Examples and Usage - DataFlair","description":"Explore HDFS commands like moveFromLocal, rm, chgrp, du, df, tail to perform operations like moving a file, changing group of a file, with example, usage & description.","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-hdfs-commands\/","og_locale":"en_US","og_type":"article","og_title":"Hadoop HDFS Commands with Examples and Usage - DataFlair","og_description":"Explore HDFS commands like moveFromLocal, rm, chgrp, du, df, tail to perform operations like moving a file, changing group of a file, with example, usage & description.","og_url":"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-commands\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2016-06-13T09:28:07+00:00","article_modified_time":"2021-08-25T17:04:00+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/hadoop-hdfs-commands.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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-commands\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-commands\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/beb0cab24b7aa54423a3b50e669a9dcd"},"headline":"Hadoop HDFS Commands with Examples and Usage","datePublished":"2016-06-13T09:28:07+00:00","dateModified":"2021-08-25T17:04:00+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-commands\/"},"wordCount":958,"commentCount":12,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/hadoop-hdfs-commands.jpg","keywords":["big data","hdfs chown","HDFS command list","HDFS Commands","hdfs df","hdfs du","hdfs expunge","hdfs rm","hdfs setrep","hdfs tail"],"articleSection":["HDFS Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/hadoop-hdfs-commands\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-commands\/","url":"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-commands\/","name":"Hadoop HDFS Commands with Examples and Usage - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-commands\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/hadoop-hdfs-commands.jpg","datePublished":"2016-06-13T09:28:07+00:00","dateModified":"2021-08-25T17:04:00+00:00","description":"Explore HDFS commands like moveFromLocal, rm, chgrp, du, df, tail to perform operations like moving a file, changing group of a file, with example, usage & description.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-commands\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/hadoop-hdfs-commands\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-commands\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/hadoop-hdfs-commands.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/hadoop-hdfs-commands.jpg","width":802,"height":420,"caption":"hdfs commands"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"HDFS Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/hdfs\/"},{"@type":"ListItem","position":3,"name":"Hadoop HDFS Commands with Examples and Usage"}]},{"@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\/beb0cab24b7aa54423a3b50e669a9dcd","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team specializes in creating clear, actionable content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Backed by industry expertise, we make learning easy and career-oriented for beginners and pros alike.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam3\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/446","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\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=446"}],"version-history":[{"count":18,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/446\/revisions"}],"predecessor-version":[{"id":75826,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/446\/revisions\/75826"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/75546"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}