Skip to main content

head-object

The aws s3api head-object command is used to retrieve metadata from a specified object in a bucket without returning the object itself. This is useful for verifying the existence and details of an object.

aws s3api head-object --bucket BUCKET_NAME --key OBJECT_KEY

This command will return metadata about the specified object.

Syntax

aws s3api head-object \
--bucket BUCKET_NAME \
--key OBJECT_KEY

Options

  • --bucket: Specifies the name of the Astran S3 bucket for which metadata is being retrieved.
  • --key: Identifies the object key for which metadata is being retrieved.

  • --version-id: Specifies the version ID of the object version for which metadata is being retrieved

See also the original AWS documentation.