Basic Operations Object Storage
Diese Seite ist noch nicht in deiner Sprache verfügbar. Englische Seite aufrufen
Bucket creation
Section titled “Bucket creation”To create a new bucket use the make bucket (mb) command. The bucket name hast to start with s3://.
In this example the bucket s3://my-example-bucket will be created. If it was successful, you will see this output:
$ s3cmd mb s3://my-example-bucketBucket 's3://my-example-bucket/' createdList buckets and files
Section titled “List buckets and files”To list all existing buckets, you can use the ls command.
$ s3cmd ls2021-12-01 10:20 s3://my-example-bucketIf you want to list all files in a bucket, you add the bucket name as an additional argument. In the following output you can see that there is one file in the my-example-bucket bucket.
$ s3cmd ls s3://my-example-bucket/2021-12-01 10:39 27 s3://my-example-bucket/testfile.txtBucket deletion
Section titled “Bucket deletion”The bucket deletion works analog to the creation. But instead of the mb command you use the remove bucket (rb) command.
In this example the bucket s3://my-example-bucket will be deleted. This will take about 10 seconds. If it was successful you will see this output:
$ s3cmd rb s3://my-example-bucketBucket 's3://my-example-bucket/' removedUploading files
Section titled “Uploading files”To upload files into a bucket use the put command. You have to add the filename and the bucket name as parameters.
In this example the file testfile.txt is uploaded to the bucket s3://my-example-bucket.
$ s3cmd put testfile.txt s3://my-example-bucketupload: 'testfile.txt' -> 's3://my-example-bucket/testfile.txt' [1 of 1] 27 of 27 100% in 0s 1829.89 B/s doneDeleting files
Section titled “Deleting files”If you want to delete a file from your bucket you need to specify the delete (del) command. But after the bucket name you need to specify the file you want to delete. In this example testfile.txt will be deleted. If it was successful you will see this output:
$ s3cmd del s3://my-example-bucket/testfile.txtdelete: 's3://my-example-bucket/testfile.txt