Reputation: 238
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
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