Yes, you can do this. You can use hdfs command to list the files and then use grep to find the pattern in those files. Example:
hadoop fs -ls pat/to/dir | grep password
This will filter the files and list only those files that have the word you are looking for.