EliranA
EliranA

Reputation: 238

How can I get the creation date of folder in Ambari HDFS with Linux commands?

Yo,

I'm trying to get the creation date of several folders. If the date is 14 days ago, I want to remove it.

BUT, I can't find appropriate hdfs command to get the creation date. I thought of:

hdfs dfs -ls /mainFolder/subFolder

and then parse the output. This is very unprofessional, must be easier way.

Thanks in advance!!!

Upvotes: 3

Views: 2578

Answers (1)

cjackson
cjackson

Reputation: 1637

Use the stat command with the default format. It will print out the modification date of the provided file/folder. See the File System Shell Hadoop Reference for more information.

For example:

$hadoop fs -stat /user
2016-03-28 17:14:53

Upvotes: 5

Related Questions