Help Center/ Object Storage Service/ Tools Guide/ obsutil/ FAQ/ Can I Check Whether an Object Exists?
Updated on 2026-09-20 GMT+08:00

Can I Check Whether an Object Exists?

Yes. You can run the stat command to check whether an object exists.

obsutil stat obs://bucket/key 
  • If the object exists, the object attributes, such as LastModified, Size, StorageClass, and ETag, are returned.
  • If the object does not exist, error code 404 is returned.

If the object exists and error code 403 is returned, you may have insufficient permissions. In this case, resolve the permission issue first by referring to Access Control.