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,170 points
1,296 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.

  • 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,060 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,150 points
11,296 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
4,683 views
+1 vote
3 answers

How to get ARN for s3 Bucket using aws cli .

An ARN is a non-opaque, constructible identifier, ...READ MORE

answered Aug 16, 2018 in AWS by Priyaj
• 58,100 points
3,263 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,100 points
1,798 views
0 votes
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,100 points
2,594 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,810 points
1,475 views
0 votes
2 answers