LinuxCommandLibrary

aws-s3

aws-s3

TLDR

Show files in a bucket

$ aws s3 ls [bucket_name]
copy


Sync files and directories from local to bucket
$ aws s3 sync [path/to/files] s3://[bucket_name]
copy


Sync files and directories from bucket to local
$ aws s3 sync s3://[bucket_name] [path/to/target]
copy


Sync files and directories with exclusions
$ aws s3 sync [path/to/files] s3://[bucket_name] --exclude [path/to/file] --exclude [path/to/directory]/*
copy


Remove file from bucket
$ aws s3 rm s3://[bucket]/[path/to/file]
copy


Preview changes only
$ aws s3 [any_command] --dryrun
copy

Copied to clipboard