EliranA
EliranA

Reputation: 238

How to delete hdfs files from last month?

I want to delete hdfs files from last month. It doesn't matter if it deleted to trash or deleted permanently.

Maybe regex can assist here?

Upvotes: 1

Views: 82

Answers (1)

EliranA
EliranA

Reputation: 238

I found an answer that helped me with this question using regex:

hadoop fs -rm -R -skipTrash /folderA/folderB/[0-9][0-9]82016*

This way I will delete all folders and their content from August 2016. Without -R I will skip recursive deletion. -skipTrash will delete the files permanently.

Upvotes: 1

Related Questions