HDFS Basic Command |
Tasks |
hdfs dfs -put logs.csv /data/ |
This command is used to upload the files from local file system to HDFS |
hdfs dfs -cat /data/logs.csv |
This command is used to read the content from the file |
hdfs dfs -chmod 744 /data/logs.csv |
This command is used to change the permission of the files |
hdfs dfs -chmod –R 744 /data/logs.csv |
This command is used to change the permission of the files recursively |
hdfs dfs -setrep -w 5 /data/logs.csv |
This command is used to set the replication factor to 5 |
hdfs dfs -du -h /data/logs.csv |
This command is used to check the size of the file |
hdfs dfs -mv logs.csv logs/ |
This command is used to move the files to a newly created subdirectory |
hdfs dfs -rm -r logs |
This command is used to remove the directories from Hdfs |
stop-all.sh |
This command is used to stop the cluster |
start-all.sh |
This command is used to start the cluster |
Hadoop version |
This command is used to check the version of Hadoop |
hdfs fsck/ |
This command is used to check the health of the files |
Hdfs dfsadmin –safemode leave |
This command is used to turn off the safemode of namenode |
Hdfs namenode -format |
This command is used to format the NameNode |
hadoop [–config confdir]archive -archiveName NAME -p |
This command is used to create a Hadoop archieve |
hadoop fs [generic options] -touchz <path> … |
This is used to create an empty files in a hdfs directory |
hdfs dfs [generic options] -getmerge [-nl] <src> <localdst> |
This is used to concatenate all files in a directory into one file |
hdfs dfs -chown -R admin:hadoop /new-dir |
This is used to change the owner of the group |