HDFS find

Share

                               HDFS find

In Hadoop Distributed File System (HDFS), there is no built-in command or tool specifically named “find” for searching files or directories as you might find in typical Unix-like file systems. However, you can achieve similar functionality using the hadoop fs command and a combination of other commands or tools available in the Hadoop ecosystem.

One way to search for files or directories in HDFS is by using the hadoop fs -ls command to list the contents of a directory and then filter the results based on your search criteria. Here’s an example of how you can do this:

bash
hadoop fs -ls -R /path/to/start | grep "search_term"
  • -ls -R is used to recursively list all files and directories under the specified starting directory (/path/to/start).
  • grep "search_term" filters the list to include only entries that match the search term you specify.

For instance, if you want to find all files or directories with “example” in their name under the /user/hadoop directory, you can use:

bash
hadoop fs -ls -R /user/hadoop | grep "example"

This command will list all entries containing “example” in their name within the /user/hadoop directory and its subdirectories.

Please replace /path/to/start and "search_term" with the appropriate path and search criteria for your specific use case.

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 *