Sunteți pe pagina 1din 2

HDFS Commands

What is command to listing directory contents in HDFS root directory? dfs


hdfs dfs -ls

Command Create a directory in HDFS user home with name “week3”?


hdfs dfs –mkdir /user/home/week3

Copy a file named “dataset.csv.tar.gz” to HDFS at week3 directory at home folder (provide 2
commands) with names dataset1.csv.tar.gz and dataset2.csv.tar.gz.
hdfs dfs -copyFromLocal /home/cloudera/sri/dataset.tar.gz
/user/brahm/week3/dataset1.tar.gz hdfs dfs -copyFromLocal
/home/cloudera/sri/dataset.tar.gz /user/brahm/week3/dataset2.tar.gz

How to rename dataset2.csv.tar.gz to dataset3.csv.tar.gz in HDFS.


hdfs dfs -mv /user/brahm/week3/dataset2.tar.gz /user/brahm/week3/dataset3.tar.gz

How to delete directory named “sample-datesets” (Ex: if the size of file is 3 TB, HDFS capacity
should be increased by 3 TB after file delete).
How to take file from hdfs to local machine. (specify all possible commands)
hdfs dfs –copyToLocal
hdfs dfs -get

How to add executable permission to a specific directory and it’s internal files/dirs in HDFS?
hdfs dfs –chmod +x /user/brahm/week3/dataset1/tar/gz

What are the demons in Hadoop HDFS?


 NameNode – Is is the Master node which is responsible for storing the meta-data for all
the files and directories. It has information such as the blocks that make a file, and where
are those blocks located in the cluster.
 DataNode – It is the Slave node that contains the actual data.

S-ar putea să vă placă și