How to edit files in the AWS S3 bucket from CLI

0 votes
Hi Guys,

I have uploaded one file in the s3 bucket. Now I want to modify the file in s3 bucket. How can I do that?
Jun 8, 2020 in AWS by akhtar
• 38,260 points
9,711 views

1 answer to this question.

0 votes

Hi@akhtar,

According to my knowledge,  you can't edit s3 files directly in s3. But you can sync your bucket locally and upload your changes to the s3 bucket. Learn more about Migrating to AWS s3 and its framework from the AWS Training.

  • First, sync your file from the s3 bucket to your local system.
C:\Users\NADIM AKTHAR\Desktop\New folder>aws s3 sync s3://bucketnadim bucket.txt
download: s3://bucketnadim/bucket.txt to bucket.txt\bucket.txt
download: s3://bucketnadim/123.jpg to bucket.txt\123.jpg
  • Then modify your file and upload it to the s3 bucket.
C:\Users\NADIM AKTHAR\Desktop\New folder>aws s3 sync bucket.txt s3://bucketnadim
upload: bucket.txt\bucket.txt to s3://bucketnadim/bucket.txt

Hope this will help.

answered Jun 8, 2020 by MD
• 95,460 points

Related Questions In AWS

0 votes
1 answer

How to download the latest file in a S3 bucket using AWS CLI?

You can use the below command $ aws ...READ MORE

answered Sep 6, 2018 in AWS by Archana
• 4,170 points
19,876 views
0 votes
2 answers

How to access files in S3 bucket from R?

You can take a look at the ...READ MORE

answered Aug 10, 2018 in AWS by Deepthi
• 300 points
6,629 views
0 votes
1 answer

How much will it cost to read from an S3 bucket in the same region but on different account

There will be no data transfer cost ...READ MORE

answered Feb 17, 2022 in AWS by anonymous
3,165 views
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 58,020 points
5,991 views
–1 vote
1 answer

How to decrypt the encrypted S3 file using aws-encryption-cli --decrypt

Use command : aws s3 presign s3://mybucket/abc_count.png you get ...READ MORE

answered Oct 22, 2018 in AWS by Priyaj
• 58,020 points
5,225 views
0 votes
1 answer

Import my AWS credentials using python script

Using AWS Cli  Configure your IAM user then ...READ MORE

answered Nov 16, 2018 in AWS by Jino
• 5,820 points
2,881 views
0 votes
2 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP