Tuesday, October 31, 2017

Basic hadoop commands

1. Creating a directory in hdfs

$ hdfs dfs -mkdir <paths>

2. List the directories in hdfs
$ hdfs dfs  -ls  <args>

3. Permissions

4. Putting a file in to hdfs file system
$ hdfs dfs -put <local-src> ... <HDFS_dest_path>

5. Space utilization in hdfs directory
$ hdfs dfs -du URI

6. Downloading files from hdfs to local file system
$ hdfs dfs -get <hdfs_src> <localdst>

7. Merging two files
We can merge two files in hdfs file system into a single file to the local file system as below
$ hdfs dfs -getmerge <src1> <src2> <localdst> [addnl]

8. Copying files or directories recursively
$ hdfs dfs -cp <src-url> <dest-url>

9. Help command
Use help command to access hadoop command manual

10. Seeing the contents of a file
$ hdfs dfs -cat <path[filename]>

11. Copying a file from source to destination in hdfs file system
$ hdfs dfs -cp <source> <dest>

12. Copy a file using copyFromLocal and copyToLocal
$ hdfs dfs -copyFromLocal <localsrc> URI

$ hdfs dfs -copyToLocal [-ignorecrc] [-crc] URI <localdst>

13. Move file from source to destination in hdfs file system
$ hdfs dfs -mv <src> <dest>

14. Remove a file or directory from hdfs file system
$ hdfs dfs -rm <arg>

15. Remove files recursively

16. To display last few lines of a file
$ hdfs dfs -tail <path[filename]>

17. Hadoop version

18. To check amount of space used by hdfs file system

19. To count the number of files and directories in hdfs


  1. Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site.

  2. Appreciation for really being thoughtful and also for deciding on certain marvelous guides most people really want to be aware of.
    Best Hadoop Training Institute In chennai

  3. This comment has been removed by the author.

  4. I have to voice my passion for your kindness giving support to those people that should have guidance on this important matter.

  5. Thanks for your article on Android technology. Android is an open source platform that allows developers to create stunning website loaded with various advanced features and functionalities.
    No.1 Vacation Classes for Multimedia in Chennai | Perfect Summer Courses for IT in Chennai

  6. A course in information science can enable you to have that additional edge over different representatives, and it can likewise enable you to expand your current bundle. ExcelR Data Science Courses


Loading xml file data to oracle table using python

Sample xml file (test.xml): <?xml version="1.0"?> <data>     <customer name="Ravi" >     ...