
上QQ阅读APP看书,第一时间看更新
Deleting files and folders in HDFS
In the previous example, we copied the test.txt file in the hadooptest folder. Let's now try to delete this file. To delete it from HDFS, execute the following command:
$ hdfs dfs -rm /hadooptest/test.txt
Now we will try to delete the folder hadooptest, which we created in our first example of working with Hadoop hands-on. To delete this folder from HDFS, execute the following command:
$ hdfs dfs -rmdir /hadooptest
The output of the preceding command should be similar to the following screenshot:

Figure-3.2.4