Kiran Dalvi
- 22 Nov, 2021
- 0 Comments
- 1 Min Read
Important HDFS Command
HDFS is the primary or major component of the Hadoop ecosystem which is responsible for storing large data sets of structured or unstructured data across various nodes and thereby maintaining the metadata in the form of log files. To use the HDFS commands, first you need to start the Hadoop services using the following command: Hadoop works on its own File System which is distributed in nature known as “Hadoop distributed File System HDFS”. Hadoop relies on distributed storage and parallel processing.
1. version
2. mkdir
3. ls
4. put
5. copyFromLocal
6. get
7. copyToLocal
8. cat
9. mv
10. cp
11. du
12. text
13. count
14. setrep
15. start-all.sh
16. jps
17. chmod
18. getmerge
1 | hadoop version |
1 | hdfs dfs – mkdir /path/directory_name |
1 | hdfs dfs -ls /path |
1 | hdfs dfs -put <localsrc> <dest> |
1 | hdfs dfs -copyFromLocal <localsrc> <hdfs destination> |
1 | hdfs dfs -get <src> <localdest> |
1 | hdfs dfs -copyToLocal <hdfs source> <localdst> |
1 | hdfs dfs –cat /path_to_file_in_hdfs |
1 | hdfs dfs -mv <src> <dest> |
1 | hdfs dfs -cp <src> <dest> |
1 | hdfs dfs –du –s /directory/filename |
1 | hdfs dfs –text /directory/filename |
1 | hdfs dfs - count <path> |
1 | hdfs dfs -setrep -R 4 /geeks |
1 | hdfs dfs - chmod [-R] <mode> <path> |
1 | hdfs dfs -getmerge <src> <localdest> |