Hadoop FS find

Share

                    Hadoop FS find

The hadoop fs -find command is used to search for files and directories within the Hadoop Distributed File System (HDFS) that match a specific pattern. This command is similar to the Unix/Linux find command for searching files and directories.

Here is the basic syntax of the hadoop fs -find command:

bash
hadoop fs -find <path> -name "<pattern>"
  • <path>: The starting directory within HDFS where you want to begin your search.
  • "<pattern>": The search pattern you want to match against filenames and directories. You can use wildcards like * (matches any sequence of characters) and ? (matches any single character) in the pattern.

For example, if you want to find all files and directories under the /user/hadoop directory in HDFS that have “data” in their names, you can use the following command:

bash
hadoop fs -find /user/hadoop -name "*data*"

This command will list all files and directories within /user/hadoop that contain the word “data” in their names.

Here are a few additional options you can use with the hadoop fs -find command:

  • -type <file|directory>: Specifies whether you want to search for files or directories. For example, -type f searches for files, and -type d searches for directories.

  • -print: This option is not required and is used by default. It prints the matching file or directory paths to the console.

  • -prune: Allows you to exclude certain directories from the search. For example, you can use -prune -path "/user/hadoop/exclude" to exclude the /user/hadoop/exclude directory from the search.

Keep in mind that the hadoop fs -find command operates within HDFS, so it searches for files and directories stored in Hadoop’s distributed file system.

Hadoop Training Demo Day 1 Video:

 
You can find more information about Hadoop Training in this Hadoop Docs Link

 

Conclusion:

Unogeeks is the No.1 IT Training Institute for Hadoop Training. Anyone Disagree? Please drop in a comment

You can check out our other latest blogs on Hadoop Training here – Hadoop Blogs

Please check out our Best In Class Hadoop Training Details here – Hadoop Training

💬 Follow & Connect with us:

———————————-

For Training inquiries:

Call/Whatsapp: +91 73960 33555

Mail us at: info@unogeeks.com

Our Website ➜ https://unogeeks.com

Follow us:

Instagram: https://www.instagram.com/unogeeks

Facebook:https://www.facebook.com/UnogeeksSoftwareTrainingInstitute

Twitter: https://twitter.com/unogeeks


Share

Leave a Reply

Your email address will not be published. Required fields are marked *