如何使用Linux命令获取Ambari HDFS中文件夹的创建日期?(How can I get the creation date of folder in Ambari HDFS with Lin

编程入门 行业动态 更新时间:2024-10-28 10:23:10
如何使用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/subFolder

and 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:53

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

更多推荐

本文发布于:2023-08-05 14:01:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1434767.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   文件夹   创建日期   命令   Ambari

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!