Reputation: 2322
Is there a way to locate a specific file in hadoop?
I know, that I can use this:
hadoop fs -find /some_directory
But, is there a command like this: hadoop locate some_file_name
?
Upvotes: 9
Views: 30560
Reputation: 11
You can list the directories and grep the result:
hdfs dfs -ls -R /anyDirectory/* | grep theFileNameISearch
Upvotes: 1
Reputation: 8937
If you are looking for equivalent of locate Linux command than such option does not exist in Hadoop. But if you are looking for the way of how to find specific file you can use name parameter of fs -find command for this:
hadoop fs -find /some_directory -name some_file_name
If you are looking for the actual location of hdfs file in your local file system you can use fsck command for this:
hdfs fsck /some_directory/some_file_name -files -blocks -locations
Upvotes: 23