0
votes

When Bucket versioning is enabled, we can get all versions of a file by typing

gsutil ls -a gs://path/to/file

However, It only shows the original file name and generation number...
Is there a way to see when those files were uploaded?

1

1 Answers

1
votes

You should be able to achieve that using the following command:

gsutil ls -a -L gs://[BUCKET_NAME]/[FILE_NAME]

As specified in this documentation, using the -a flag will list both live and noncurrent versions of the specified object. The -L flag will provide additional information about this object, containing the Creation time of the object.

If there's too much information shown using the previous command, the following command will show only the filename (along with the generation number) and the creation time:

gsutil ls -a -L gs://[BUCKET_NAME]/[FILE_NAME] | grep 'gs://\|Creation time'