Support Questions

Find answers, ask questions, and share your expertise

How to use HdfsFindTool find to filter directories from last modified date as yesterdays in Hdfs.

New Contributor

Hello all,

 

I am working on a shell script to list all the files in Hdfs which got last modified yesterday.I used for link in hadoop jar $jar/search-mr-job.jar \ org.apache.solr.hadoop.HdfsFindTool \ -find $path/* -prune -type d -newermt $(date -d "yesterday" '+%Y-%m-%d')

But i am getting like this "find: Unexpected argument: -newerat"

 

Do anyone having idea how i can find hdfs files which were last modified yesterday?

1 REPLY 1

Explorer

You could do a 

hdfs dfs -ls /pathname | grep -i (yesterday's date as per the list command)