gsutil/gcloud存储文件列表排序日期降序? [英] gsutil / gcloud storage file listing sorted date descending?
本文介绍了gsutil/gcloud存储文件列表排序日期降序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否无法从按日期降序排序的Google Cloud Storage存储桶中列出文件?这非常令人沮丧.我需要检查上传文件的状态,并且存储桶中有成千上万个对象.
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
没有标准的Linux -t
选项.
gsutil ls
does not have the standard linux -t
option.
Google云控制台也会列出它,但不提供排序选项.
Google cloud console also lists it but does not offer sorting options.
推荐答案
我将其用作解决方法:
gsutil ls -l gs://[bucket-name]/ | sort -k 2
这将输出完整列表,包括日期作为第二个字段,sort -k 2
然后按该字段排序.
This outputs full listing including date as the second field, sort -k 2
then sorts by this field.
这篇关于gsutil/gcloud存储文件列表排序日期降序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文