0% found this document useful (0 votes)
4 views

Hdfs

Uploaded by

Nakul Arora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Hdfs

Uploaded by

Nakul Arora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Q1.

Create a folder in hadoop as /user/test

hdfs dfs -mkdir /user/test

Q2. Issue a command in hadoop to check if the folder /user/test exists

hdfs dfs -ls /user/

Q3. Copy file 't.txt' from under the Documents to hadoop in the folder /user/test/

hdfs dfs -copyFromLocal /home/ashok/Documents/t.txt /user/test/

Q4. Issue command to check if the file t.txt has actually been copied to hadoop folder /user/test/

hdfs dfs -ls /user/test/

Q5. Create a series of folders in hadoop with a single command /user/dfg/qwe/abc/

hdfs dfs -mkdir -p /user/dfg/qwe/abc/

Q6. Move the file t.txt from hadoop folder /user/test/ to hadoop folder /user/dfg/qwe/abc/

hdfs dfs -mv /user/test/t.txt /user/dfg/qwe/abc/

Q7. Display on the terminal the contents of file t.txt located in the hadoop folder
/user/dfg/qwe/abc/

hdfs dfs -cat /user/dfg/qwe/abc/t.txt

Q8. Copy file t.txt from the hadoop folder /user/dfg/qwe/abc/ to linux folder /home/ashok/

hdfs dfs -copyToLocal /user/dfg/qwe/abc/t.txt /home/ashok/

Q9. Check that file t.txt now exists in the linux folder /home/ashok/

ls /home/ashok/

Q10. Delete file t.txt from the hadoop folder /user/dfg/qwe/abc/

hdfs dfs -rm /user/dfg/qwe/abc/t.txt

Q11. Delete folder dfg and all other folders under /user/dfg/qwe/abc/ with a single command

hdfs dfs -rm -r /user/dfg/

You might also like