gsutil -q stat gs://bucket/file
If this command returns 0 (false), the file does not exist at all.
If this command returns non-zero (true), the file already exists.
【Reference】
Gsutil - How can I check if a file exists in a GCS bucket (a sub-directory) using Gsutil
No comments:
Post a Comment