如何使用Linux命令获取Ambari HDFS中文件夹的创建日期?(How can I get the creation date of folder in Ambari HDFS with Linux commands?)
哟,
我正在尝试获取几个文件夹的创建日期。 如果日期是14天前,我想删除它。
但是,我找不到合适的hdfs命令来获取创建日期。 我想到了:
hdfs dfs -ls /mainFolder/subFolder然后解析输出。 这是非常不专业,必须更容易的方式。
提前致谢!!!
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/subFolderand then parse the output. This is very unprofessional, must be easier way.
Thanks in advance!!!
最满意答案
使用具有默认格式的stat命令。 它将打印出所提供文件/文件夹的修改日期。 有关更多信息,请参见文件系统Shell Hadoop参考 。
例如:
$hadoop fs -stat /user 2016-03-28 17:14:53Use 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更多推荐
发布评论