gsutil/gcloud 存储文件列表排序日期降序? [英] gsutil / gcloud storage file listing sorted date descending?

查看:24
本文介绍了gsutil/gcloud 存储文件列表排序日期降序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Is there no way to get a file listing out from a Google Cloud Storage bucket that is sorted by date descending? This is very frustrating. I need to check the status of files that are uploaded and the bucket has thousands of objects.

gsutil ls does not have the standard linux -t option.

Google cloud console also lists it but does not offer sorting options.

解决方案

I use this as a workaround:

gsutil ls -l gs://[bucket-name]/ | sort -k 2

This outputs full listing including date as the second field, sort -k 2 then sorts by this field.

这篇关于gsutil/gcloud 存储文件列表排序日期降序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆