Hadoop HDFS Task Operations (.add/ .delete/ .retrieve) - IndianTechnoEra
Latest update Android YouTube

Hadoop HDFS Task Operations (.add/ .delete/ .retrieve)

 

Implement .add .retrieve .delete tasks in Hadoop | IndianTechnoEra

Aim: Implement the following file management tasks in Hadoop: 

 ∙ Adding files and directories

 ∙ Retrieving files from HDFS to local filesystem 

 ∙ Deleting Files from HDFS

Procedure: 

Step 1: Adding Files and Directories to HDFS

: Before you can run Hadoop programs on data stored in HDFS, you’ll need to put the data into HDFS first. Let’s create a directory and put a file in it

hadoop fs -mkdir /user/myfile

hadoop fs -put a.txt

hadoop fs -put a.txt /user/myfile 

Step 2: Retrieving Files from HDFS

The Hadoop command get copies files from HDFS back to the local filesystem. To retrieve a.txt, we can run the following command:

hadoop fs -cat a.txt

Step 3: Deleting Files from HDFS

hadoop fs -rm a.txt


Output: 

Post a Comment

Feel free to ask your query...
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.