{
    "mode": "man",
    "parameter": "s3cmd",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/s3cmd/1/json",
    "generated": "2026-06-10T16:21:55Z",
    "synopsis": "s3cmd [OPTIONS] COMMAND [PARAMETERS]",
    "sections": {
        "NAME": {
            "content": "s3cmd - tool for managing Amazon S3 storage space and Amazon CloudFront content delivery net‐\nwork\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "s3cmd [OPTIONS] COMMAND [PARAMETERS]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "s3cmd is a command line client for copying files to/from Amazon S3 (Simple  Storage  Service)\nand  performing  other related tasks, for instance creating and removing buckets, listing ob‐\njects, etc.\n\n",
            "subsections": []
        },
        "COMMANDS": {
            "content": "s3cmd can do several actions specified by the following commands.\n\ns3cmd mb s3://BUCKET\nMake bucket\n\ns3cmd rb s3://BUCKET\nRemove bucket\n\ns3cmd ls [s3://BUCKET[/PREFIX]]\nList objects or buckets\n\ns3cmd la\nList all object in all buckets\n\ns3cmd put FILE [FILE...] s3://BUCKET[/PREFIX]\nPut file into bucket\n\ns3cmd get s3://BUCKET/OBJECT LOCALFILE\nGet file from bucket\n\ns3cmd del s3://BUCKET/OBJECT\nDelete file from bucket\n\ns3cmd rm s3://BUCKET/OBJECT\nDelete file from bucket (alias for del)\n\ns3cmd restore s3://BUCKET/OBJECT\nRestore file from Glacier storage\n\ns3cmd   sync   LOCALDIR   s3://BUCKET[/PREFIX]   or   s3://BUCKET[/PREFIX]   LOCALDIR    or\ns3://BUCKET[/PREFIX] s3://BUCKET[/PREFIX]\nSynchronize  a  directory tree to S3 (checks files freshness using size and md5 check‐\nsum, unless overridden by options, see below)\n\ns3cmd du [s3://BUCKET[/PREFIX]]\nDisk usage by buckets\n\ns3cmd info s3://BUCKET[/OBJECT]\nGet various information about Buckets or Files\n\ns3cmd cp s3://BUCKET1/OBJECT1 s3://BUCKET2[/OBJECT2]\nCopy object\n\ns3cmd modify s3://BUCKET1/OBJECT\nModify object metadata\n\ns3cmd mv s3://BUCKET1/OBJECT1 s3://BUCKET2[/OBJECT2]\nMove object\n\ns3cmd setacl s3://BUCKET[/OBJECT]\nModify Access control list for Bucket or Files\n\ns3cmd setpolicy FILE s3://BUCKET\nModify Bucket Policy\n\ns3cmd delpolicy s3://BUCKET\nDelete Bucket Policy\n\ns3cmd setcors FILE s3://BUCKET\nModify Bucket CORS\n\ns3cmd delcors s3://BUCKET\nDelete Bucket CORS\n\ns3cmd payer s3://BUCKET\nModify Bucket Requester Pays policy\n\ns3cmd multipart s3://BUCKET [Id]\nShow multipart uploads\n\ns3cmd abortmp s3://BUCKET/OBJECT Id\nAbort a multipart upload\n\ns3cmd listmp s3://BUCKET/OBJECT Id\nList parts of a multipart upload\n\ns3cmd accesslog s3://BUCKET\nEnable/disable bucket access logging\n\ns3cmd sign STRING-TO-SIGN\nSign arbitrary string using the secret key\n\ns3cmd signurl s3://BUCKET/OBJECT <expiryepoch|+expiryoffset>\nSign an S3 URL to provide limited public access with expiry\n\ns3cmd fixbucket s3://BUCKET[/PREFIX]\nFix invalid file names in a bucket\n\ns3cmd expire s3://BUCKET\nSet or delete expiration rule for the bucket\n\ns3cmd setlifecycle FILE s3://BUCKET\nUpload a lifecycle policy for the bucket\n\ns3cmd getlifecycle s3://BUCKET\nGet a lifecycle policy for the bucket\n\ns3cmd dellifecycle s3://BUCKET\nRemove a lifecycle policy for the bucket\n\n\n\nCommands for static WebSites configuration\n\ns3cmd ws-create s3://BUCKET\nCreate Website from bucket\n\ns3cmd ws-delete s3://BUCKET\nDelete Website\n\ns3cmd ws-info s3://BUCKET\nInfo about Website\n\n\n\nCommands for CloudFront management\n\ns3cmd cflist\nList CloudFront distribution points\n\ns3cmd cfinfo [cf://DISTID]\nDisplay CloudFront distribution point parameters\n\ns3cmd cfcreate s3://BUCKET\nCreate CloudFront distribution point\n\ns3cmd cfdelete cf://DISTID\nDelete CloudFront distribution point\n\ns3cmd cfmodify cf://DISTID\nChange CloudFront distribution point parameters\n\ns3cmd cfinvalinfo cf://DISTID[/INVALID]\nDisplay CloudFront invalidation request(s) status\n\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "Some of the below specified options can have their default values set in  s3cmd  config  file\n(by default $HOME/.s3cmd). As it's a simple text file feel free to open it with your favorite\ntext editor and do any changes you like.\n",
            "subsections": [
                {
                    "name": "-h --help",
                    "content": "show this help message and exit\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "--configure",
                    "content": "Invoke  interactive   (re)configuration   tool.   Optionally   use   as   '--configure\ns3://some-bucket'  to  test  access to a specific bucket instead of attempting to list\nthem all.\n",
                    "long": "--configure"
                },
                {
                    "name": "-c --config",
                    "content": "Config file name. Defaults to $HOME/.s3cfg\n",
                    "flag": "-c",
                    "long": "--config"
                },
                {
                    "name": "--dump-config",
                    "content": "Dump current configuration after parsing config files and  command  line  options  and\nexit.\n\n--accesskey=ACCESSKEY\nAWS Access Key\n\n--secretkey=SECRETKEY\nAWS Secret Key\n\n--accesstoken=ACCESSTOKEN\nAWS Access Token\n",
                    "long": "--dump-config"
                },
                {
                    "name": "-n --dry-run",
                    "content": "Only  show  what  should be uploaded or downloaded but don't actually do it. May still\nperform S3 requests to get bucket listings and other information though (only for file\ntransfer commands)\n",
                    "flag": "-n",
                    "long": "--dry-run"
                },
                {
                    "name": "-s --ssl",
                    "content": "Use HTTPS connection when communicating with S3.  (default)\n",
                    "flag": "-s",
                    "long": "--ssl"
                },
                {
                    "name": "--no-ssl",
                    "content": "Don't use HTTPS.\n",
                    "long": "--no-ssl"
                },
                {
                    "name": "-e --encrypt",
                    "content": "Encrypt files before uploading to S3.\n",
                    "flag": "-e",
                    "long": "--encrypt"
                },
                {
                    "name": "--no-encrypt",
                    "content": "Don't encrypt files.\n",
                    "long": "--no-encrypt"
                },
                {
                    "name": "-f --force",
                    "content": "Force overwrite and other dangerous operations.\n",
                    "flag": "-f",
                    "long": "--force"
                },
                {
                    "name": "--continue",
                    "content": "Continue getting a partially downloaded file (only for [get] command).\n",
                    "long": "--continue"
                },
                {
                    "name": "--continue-put",
                    "content": "Continue  uploading  partially  uploaded  files  or  multipart upload parts.  Restarts\nparts/files that don't have matching size and md5.  Skips files/parts that do.   Note:\nmd5sum checks are not always sufficient to check (part) file equality.  Enable this at\nyour own risk.\n\n--upload-id=UPLOADID\nUploadId for Multipart Upload, in case you want continue an existing  upload  (equiva‐\nlent  to --continue- put) and there are multiple partial uploads.  Use s3cmd multipart\n[URI] to see what UploadIds are associated with the given URI.\n",
                    "long": "--continue-put"
                },
                {
                    "name": "--skip-existing",
                    "content": "Skip over files that exist at the destination (only for [get] and [sync] commands).\n",
                    "long": "--skip-existing"
                },
                {
                    "name": "-r --recursive",
                    "content": "Recursive upload, download or removal.\n",
                    "flag": "-r",
                    "long": "--recursive"
                },
                {
                    "name": "--check-md5",
                    "content": "Check MD5 sums when comparing files for [sync].  (default)\n",
                    "long": "--check-md5"
                },
                {
                    "name": "--no-check-md5",
                    "content": "Do not check MD5 sums when comparing files for [sync].  Only size  will  be  compared.\nMay significantly speed up transfer but may also miss some changed files.\n",
                    "long": "--no-check-md5"
                },
                {
                    "name": "-P --acl-public",
                    "content": "Store objects with ACL allowing read for anyone.\n",
                    "flag": "-P",
                    "long": "--acl-public"
                },
                {
                    "name": "--acl-private",
                    "content": "Store objects with default ACL allowing access for you only.\n\n--acl-grant=PERMISSION:EMAIL or USERCANONICALID\nGrant  stated  permission  to a given amazon user.  Permission is one of: read, write,\nreadacp, writeacp, fullcontrol, all\n\n--acl-revoke=PERMISSION:USERCANONICALID\nRevoke stated permission for a given amazon user.  Permission is one of: read,  write,\nreadacp, writeacp, fullcontrol, all\n",
                    "long": "--acl-private"
                },
                {
                    "name": "-D --restore-days",
                    "content": "Number  of  days to keep restored file available (only for 'restore' command). Default\nis 1 day.\n\n--restore-priority=RESTOREPRIORITY\nPriority for restoring files from S3 Glacier (only for expedited\n",
                    "flag": "-D",
                    "long": "--restore-days"
                },
                {
                    "name": "--delete-removed",
                    "content": "Delete destination objects with no corresponding source file [sync]\n",
                    "long": "--delete-removed"
                },
                {
                    "name": "--no-delete-removed",
                    "content": "Don't delete destination objects [sync]\n",
                    "long": "--no-delete-removed"
                },
                {
                    "name": "--delete-after",
                    "content": "Perform deletes AFTER new uploads when delete-removed is enabled [sync]\n",
                    "long": "--delete-after"
                },
                {
                    "name": "--delay-updates",
                    "content": "*OBSOLETE* Put all updated files into place at end [sync]\n\n--max-delete=NUM\nDo not delete more than NUM files. [del] and [sync]\n\n--limit=NUM\nLimit number of objects returned in the response body (only for  [ls]  and  [la]  com‐\nmands)\n\n--add-destination=ADDITIONALDESTINATIONS\nAdditional  destination  for  parallel  uploads,  in addition to last arg.  May be re‐\npeated.\n",
                    "long": "--delay-updates"
                },
                {
                    "name": "--delete-after-fetch",
                    "content": "Delete remote objects after fetching to local file (only for  [get]  and  [sync]  com‐\nmands).\n",
                    "long": "--delete-after-fetch"
                },
                {
                    "name": "-p --preserve",
                    "content": "Preserve  filesystem attributes (mode, ownership, timestamps). Default for [sync] com‐\nmand.\n",
                    "flag": "-p",
                    "long": "--preserve"
                },
                {
                    "name": "--no-preserve",
                    "content": "Don't store FS attributes\n\n--exclude=GLOB\nFilenames and paths matching GLOB will be excluded from sync\n\n--exclude-from=FILE\nRead --exclude GLOBs from FILE\n\n--rexclude=REGEXP\nFilenames and paths matching REGEXP (regular expression) will be excluded from sync\n\n--rexclude-from=FILE\nRead --rexclude REGEXPs from FILE\n\n--include=GLOB\nFilenames and paths matching GLOB will be included even if previously excluded by  one\nof --(r)exclude(-from) patterns\n\n--include-from=FILE\nRead --include GLOBs from FILE\n\n--rinclude=REGEXP\nSame as --include but uses REGEXP (regular expression) instead of GLOB\n\n--rinclude-from=FILE\nRead --rinclude REGEXPs from FILE\n\n--files-from=FILE\nRead list of source-file names from FILE. Use - to read from stdin.\n\n--region=REGION, --bucket-location=REGION\nRegion  to  create  bucket  in.  As  of  now  the  regions  are: us-east-1, us-west-1,\nus-west-2, eu-west-1, eu- central-1, ap-northeast-1, ap-southeast-1, ap-  southeast-2,\nsa-east-1\n\n--host=HOSTNAME\nHOSTNAME:PORT  for S3 endpoint (default: s3.amazonaws.com, alternatives such as s3-eu-\nwest-1.amazonaws.com). You should also set --host- bucket.\n\n--host-bucket=HOSTBUCKET\nDNS-style   bucket+hostname:port   template   for   accessing   a   bucket   (default:\n%(bucket)s.s3.amazonaws.com)\n\n--reduced-redundancy, --rr\nStore object with 'Reduced redundancy'. Lower per-GB price. [put, cp, mv]\n\n--no-reduced-redundancy, --no-rr\nStore object without 'Reduced redundancy'. Higher per- GB price. [put, cp, mv]\n\n--storage-class=CLASS\nStore  object  with  specified  CLASS  (STANDARD,  STANDARDIA,  ONEZONEIA,  INTELLI‐\nGENTTIERING, GLACIER or DEEPARCHIVE). [put, cp, mv]\n\n--access-logging-target-prefix=LOGTARGETPREFIX\nTarget prefix for access logs (S3 URI) (for [cfmodify] and [accesslog] commands)\n",
                    "long": "--no-preserve"
                },
                {
                    "name": "--no-access-logging",
                    "content": "Disable access logging (for [cfmodify] and [accesslog] commands)\n\n--default-mime-type=DEFAULTMIMETYPE\nDefault MIME-type for stored objects. Application default is binary/octet-stream.\n",
                    "long": "--no-access-logging"
                },
                {
                    "name": "-M --guess-mime-type",
                    "content": "Guess MIME-type of files by their extension  or  mime  magic.  Fall  back  to  default\nMIME-Type as specified by --default-mime-type option\n",
                    "flag": "-M",
                    "long": "--guess-mime-type"
                },
                {
                    "name": "--no-guess-mime-type",
                    "content": "Don't guess MIME-type and use the default type instead.\n",
                    "long": "--no-guess-mime-type"
                },
                {
                    "name": "--no-mime-magic",
                    "content": "Don't use mime magic when guessing MIME-type.\n",
                    "long": "--no-mime-magic"
                },
                {
                    "name": "-m --mime-type",
                    "content": "Force MIME-type. Override both --default-mime-type and --guess-mime-type.\n\n--add-header=NAME:VALUE\nAdd  a  given  HTTP  header to the upload request. Can be used multiple times. For in‐\nstance set 'Expires' or 'Cache-Control' headers (or both) using this option.\n\n--remove-header=NAME\nRemove a given HTTP header.  Can be used multiple times.  For  instance,  remove  'Ex‐\npires' or 'Cache- Control' headers (or both) using this option. [modify]\n",
                    "flag": "-m",
                    "long": "--mime-type"
                },
                {
                    "name": "--server-side-encryption",
                    "content": "Specifies  that  server-side encryption will be used when putting objects. [put, sync,\ncp, modify]\n\n--server-side-encryption-kms-id=KMSKEY\nSpecifies the key id  used  for  server-side  encryption  with  AWS  KMS-Managed  Keys\n(SSE-KMS) when putting objects. [put, sync, cp, modify]\n\n--encoding=ENCODING\nOverride  autodetected terminal and filesystem encoding (character set). Autodetected:\nUTF-8\n\n--add-encoding-exts=EXTENSIONs\nAdd encoding to these comma delimited extensions i.e.  (css,js,html) when uploading to\nS3 )\n",
                    "long": "--server-side-encryption"
                },
                {
                    "name": "--verbatim",
                    "content": "Use  the  S3 name as given on the command line. No pre- processing, encoding, etc. Use\nwith caution!\n",
                    "long": "--verbatim"
                },
                {
                    "name": "--disable-multipart",
                    "content": "Disable multipart upload on files bigger than --multipart-chunk-size-mb\n\n--multipart-chunk-size-mb=SIZE\nSize of each chunk of a multipart upload. Files bigger than SIZE are automatically up‐\nloaded  as  multithreaded- multipart, smaller files are uploaded using the traditional\nmethod. SIZE is in Mega-Bytes, default chunk size is 15MB, minimum allowed chunk  size\nis 5MB, maximum is 5GB.\n",
                    "long": "--disable-multipart"
                },
                {
                    "name": "--list-md5",
                    "content": "Include MD5 sums in bucket listings (only for 'ls' command).\n",
                    "long": "--list-md5"
                },
                {
                    "name": "-H --human-readable-sizes",
                    "content": "Print sizes in human readable form (eg 1kB instead of 1234).\n\n--ws-index=WEBSITEINDEX\nName of index-document (only for [ws-create] command)\n\n--ws-error=WEBSITEERROR\nName of error-document (only for [ws-create] command)\n\n--expiry-date=EXPIRYDATE\nIndicates when the expiration rule takes effect. (only for [expire] command)\n\n--expiry-days=EXPIRYDAYS\nIndicates  the  number of days after object creation the expiration rule takes effect.\n(only for [expire] command)\n\n--expiry-prefix=EXPIRYPREFIX\nIdentifying one or more objects with the prefix to which the expiration rule  applies.\n(only for [expire] command)\n",
                    "flag": "-H",
                    "long": "--human-readable-sizes"
                },
                {
                    "name": "--progress",
                    "content": "Display progress meter (default on TTY).\n",
                    "long": "--progress"
                },
                {
                    "name": "--no-progress",
                    "content": "Don't display progress meter (default on non-TTY).\n",
                    "long": "--no-progress"
                },
                {
                    "name": "--stats",
                    "content": "Give some file-transfer stats.\n",
                    "long": "--stats"
                },
                {
                    "name": "--enable",
                    "content": "Enable given CloudFront distribution (only for [cfmodify] command)\n",
                    "long": "--enable"
                },
                {
                    "name": "--disable",
                    "content": "Disable given CloudFront distribution (only for [cfmodify] command)\n",
                    "long": "--disable"
                },
                {
                    "name": "--cf-invalidate",
                    "content": "Invalidate the uploaded filed in CloudFront. Also see [cfinval] command.\n",
                    "long": "--cf-invalidate"
                },
                {
                    "name": "--cf-invalidate-default-index",
                    "content": "When using Custom Origin and S3 static website, invalidate the default index file.\n",
                    "long": "--cf-invalidate-default-index"
                },
                {
                    "name": "--cf-no-invalidate-default-index-root",
                    "content": "When  using  Custom Origin and S3 static website, don't invalidate the path to the de‐\nfault index file.\n\n--cf-add-cname=CNAME\nAdd given CNAME to a CloudFront distribution (only for [cfcreate] and [cfmodify]  com‐\nmands)\n\n--cf-remove-cname=CNAME\nRemove given CNAME from a CloudFront distribution (only for [cfmodify] command)\n\n--cf-comment=COMMENT\nSet  COMMENT  for  a given CloudFront distribution (only for [cfcreate] and [cfmodify]\ncommands)\n\n--cf-default-root-object=DEFAULTROOTOBJECT\nSet the default root object to return when no object is specified in the  URL.  Use  a\nrelative   path,   i.e.    default/index.html   instead   of   /default/index.html  or\ns3://bucket/default/index.html (only for [cfcreate] and [cfmodify] commands)\n",
                    "long": "--cf-no-invalidate-default-index-root"
                },
                {
                    "name": "-v --verbose",
                    "content": "Enable verbose output.\n",
                    "flag": "-v",
                    "long": "--verbose"
                },
                {
                    "name": "-d --debug",
                    "content": "Enable debug output.\n",
                    "flag": "-d",
                    "long": "--debug"
                },
                {
                    "name": "--version",
                    "content": "Show s3cmd version (2.2.0) and exit.\n",
                    "long": "--version"
                },
                {
                    "name": "-F --follow-symlinks",
                    "content": "Follow symbolic links as if they are regular files\n\n--cache-file=FILE\nCache FILE containing local source MD5 values\n",
                    "flag": "-F",
                    "long": "--follow-symlinks"
                },
                {
                    "name": "-q --quiet",
                    "content": "Silence output on stdout\n\n--ca-certs=CACERTSFILE\nPath to SSL CA certificate FILE (instead of system default)\n\n--ssl-cert=SSLCLIENTCERTFILE\nPath to client own SSL certificate CRTFILE\n\n--ssl-key=SSLCLIENTKEYFILE\nPath to client own SSL certificate private key KEYFILE\n",
                    "flag": "-q",
                    "long": "--quiet"
                },
                {
                    "name": "--check-certificate",
                    "content": "Check SSL certificate validity\n",
                    "long": "--check-certificate"
                },
                {
                    "name": "--no-check-certificate",
                    "content": "Do not check SSL certificate validity\n",
                    "long": "--no-check-certificate"
                },
                {
                    "name": "--check-hostname",
                    "content": "Check SSL certificate hostname validity\n",
                    "long": "--check-hostname"
                },
                {
                    "name": "--no-check-hostname",
                    "content": "Do not check SSL certificate hostname validity\n",
                    "long": "--no-check-hostname"
                },
                {
                    "name": "--signature-v2",
                    "content": "Use AWS Signature version 2 instead of newer signature methods.  Helpful  for  S3-like\nsystems that don't have AWS Signature v4 yet.\n\n--limit-rate=LIMITRATE\nLimit  the  upload  or  download  speed to amount bytes per second.  Amount may be ex‐\npressed in bytes, kilobytes with the k suffix, or megabytes with the m suffix\n",
                    "long": "--signature-v2"
                },
                {
                    "name": "--no-connection-pooling",
                    "content": "Disable connection re-use\n",
                    "long": "--no-connection-pooling"
                },
                {
                    "name": "--requester-pays",
                    "content": "Set the REQUESTER PAYS flag for operations\n",
                    "long": "--requester-pays"
                },
                {
                    "name": "-l --long-listing",
                    "content": "Produce long listing [ls]\n",
                    "flag": "-l",
                    "long": "--long-listing"
                },
                {
                    "name": "--stop-on-error",
                    "content": "stop if error in transfer\n\n--content-disposition=CONTENTDISPOSITION\nProvide a Content-Disposition for signed URLs, e.g., \"inline; filename=myvideo.mp4\"\n\n--content-type=CONTENTTYPE\nProvide a Content-Type for signed URLs, e.g., \"video/mp4\"\n\n\n",
                    "long": "--stop-on-error"
                }
            ]
        },
        "EXAMPLES": {
            "content": "One of the most powerful commands of s3cmd is s3cmd sync used for synchronising complete  di‐\nrectory  trees  to  or from remote S3 storage. To some extent s3cmd put and s3cmd get share a\nsimilar behaviour with sync.\n\nBasic usage common in backup scenarios is as simple as:\ns3cmd sync /local/path/ s3://test-bucket/backup/\n\nThis command will find all files under /local/path directory and copy them  to  corresponding\npaths under s3://test-bucket/backup on the remote side.  For example:\n/local/path/file1.ext         ->  s3://bucket/backup/file1.ext\n/local/path/dir123/file2.bin  ->  s3://bucket/backup/dir123/file2.bin\n\nHowever  if  the local path doesn't end with a slash the last directory's name is used on the\nremote side as well. Compare these with the previous example:\ns3cmd sync /local/path s3://test-bucket/backup/\nwill sync:\n/local/path/file1.ext         ->  s3://bucket/backup/path/file1.ext\n/local/path/dir123/file2.bin  ->  s3://bucket/backup/path/dir123/file2.bin\n\nTo retrieve the files back from S3 use inverted syntax:\ns3cmd sync s3://test-bucket/backup/ ~/restore/\nthat will download files:\ns3://bucket/backup/file1.ext         ->  ~/restore/file1.ext\ns3://bucket/backup/dir123/file2.bin  ->  ~/restore/dir123/file2.bin\n\nWithout the trailing slash on source the behaviour is similar to what has  been  demonstrated\nwith upload:\ns3cmd sync s3://test-bucket/backup ~/restore/\nwill download the files as:\ns3://bucket/backup/file1.ext         ->  ~/restore/backup/file1.ext\ns3://bucket/backup/dir123/file2.bin  ->  ~/restore/backup/dir123/file2.bin\n\nAll  source file names, the bold ones above, are matched against exclude rules and those that\nmatch are then re-checked against include rules to see whether they  should  be  excluded  or\nkept in the source list.\n\nFor  the purpose of --exclude and --include matching only the bold file names above are used.\nFor instance only path/file1.ext is tested against the patterns, not /local/path/file1.ext\n\nBoth --exclude and --include work with shell-style wildcards (a.k.a. GLOB).   For  a  greater\nflexibility  s3cmd  provides  Regular-expression  versions  of  the two exclude options named\n--rexclude and --rinclude.  The options with ...-from suffix (eg  --rinclude-from)  expect  a\nfilename as an argument. Each line of such a file is treated as one pattern.\n\nThere  is  only  one set of patterns built from all --(r)exclude(-from) options and similarly\nfor include variant. Any file excluded with eg --exclude can be put back with a pattern found\nin --rinclude-from list.\n\nRun s3cmd with --dry-run to verify that your rules work as expected.  Use together with --de‐‐\nbug get detailed information about matching file names against exclude and include rules.\n\nFor example to exclude all files with \".jpg\" extension except those beginning with  a  number\nuse:\n\n--exclude '*.jpg' --rinclude '[0-9].*.jpg'\n\nTo exclude all files except \"*.jpg\" extension, use:\n\n--exclude '*' --include '*.jpg'\n\nTo exclude local directory 'somedir', be sure to use a trailing forward slash, as such:\n\n--exclude 'somedir/'\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "For the most up to date list of options run: s3cmd --help\nFor  more  info  about  usage,  examples  and  other  related info visit project homepage at:",
            "subsections": [
                {
                    "name": "http://s3tools.org",
                    "content": ""
                }
            ]
        },
        "AUTHOR": {
            "content": "Written by Michal Ludvig and contributors\n",
            "subsections": [
                {
                    "name": "CONTACT, SUPPORT",
                    "content": "Preferred way to get support is our mailing list:\ns3tools-general@lists.sourceforge.net\nor visit the project homepage:"
                },
                {
                    "name": "http://s3tools.org",
                    "content": ""
                }
            ]
        },
        "REPORTING BUGS": {
            "content": "Report bugs to s3tools-bugs@lists.sourceforge.net\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright © 2007-2015 TGRMN Software - http://www.tgrmn.com - and contributors\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "This program is free software; you can redistribute it and/or modify it under  the  terms  of\nthe GNU General Public License as published by the Free Software Foundation; either version 2\nof the License, or (at your option) any later version.  This program is  distributed  in  the\nhope  that  it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License  for\nmore details.\n\n\n\ns3cmd(1)",
            "subsections": []
        }
    },
    "summary": "s3cmd - tool for managing Amazon S3 storage space and Amazon CloudFront content delivery net‐ work",
    "flags": [
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "show this help message and exit"
        },
        {
            "flag": "",
            "long": "--configure",
            "arg": null,
            "description": "Invoke interactive (re)configuration tool. Optionally use as '--configure s3://some-bucket' to test access to a specific bucket instead of attempting to list them all."
        },
        {
            "flag": "-c",
            "long": "--config",
            "arg": null,
            "description": "Config file name. Defaults to $HOME/.s3cfg"
        },
        {
            "flag": "",
            "long": "--dump-config",
            "arg": null,
            "description": "Dump current configuration after parsing config files and command line options and exit. --accesskey=ACCESSKEY AWS Access Key --secretkey=SECRETKEY AWS Secret Key --accesstoken=ACCESSTOKEN AWS Access Token"
        },
        {
            "flag": "-n",
            "long": "--dry-run",
            "arg": null,
            "description": "Only show what should be uploaded or downloaded but don't actually do it. May still perform S3 requests to get bucket listings and other information though (only for file transfer commands)"
        },
        {
            "flag": "-s",
            "long": "--ssl",
            "arg": null,
            "description": "Use HTTPS connection when communicating with S3. (default)"
        },
        {
            "flag": "",
            "long": "--no-ssl",
            "arg": null,
            "description": "Don't use HTTPS."
        },
        {
            "flag": "-e",
            "long": "--encrypt",
            "arg": null,
            "description": "Encrypt files before uploading to S3."
        },
        {
            "flag": "",
            "long": "--no-encrypt",
            "arg": null,
            "description": "Don't encrypt files."
        },
        {
            "flag": "-f",
            "long": "--force",
            "arg": null,
            "description": "Force overwrite and other dangerous operations."
        },
        {
            "flag": "",
            "long": "--continue",
            "arg": null,
            "description": "Continue getting a partially downloaded file (only for [get] command)."
        },
        {
            "flag": "",
            "long": "--continue-put",
            "arg": null,
            "description": "Continue uploading partially uploaded files or multipart upload parts. Restarts parts/files that don't have matching size and md5. Skips files/parts that do. Note: md5sum checks are not always sufficient to check (part) file equality. Enable this at your own risk. --upload-id=UPLOADID UploadId for Multipart Upload, in case you want continue an existing upload (equiva‐ lent to --continue- put) and there are multiple partial uploads. Use s3cmd multipart [URI] to see what UploadIds are associated with the given URI."
        },
        {
            "flag": "",
            "long": "--skip-existing",
            "arg": null,
            "description": "Skip over files that exist at the destination (only for [get] and [sync] commands)."
        },
        {
            "flag": "-r",
            "long": "--recursive",
            "arg": null,
            "description": "Recursive upload, download or removal."
        },
        {
            "flag": "",
            "long": "--check-md5",
            "arg": null,
            "description": "Check MD5 sums when comparing files for [sync]. (default)"
        },
        {
            "flag": "",
            "long": "--no-check-md5",
            "arg": null,
            "description": "Do not check MD5 sums when comparing files for [sync]. Only size will be compared. May significantly speed up transfer but may also miss some changed files."
        },
        {
            "flag": "-P",
            "long": "--acl-public",
            "arg": null,
            "description": "Store objects with ACL allowing read for anyone."
        },
        {
            "flag": "",
            "long": "--acl-private",
            "arg": null,
            "description": "Store objects with default ACL allowing access for you only. --acl-grant=PERMISSION:EMAIL or USERCANONICALID Grant stated permission to a given amazon user. Permission is one of: read, write, readacp, writeacp, fullcontrol, all --acl-revoke=PERMISSION:USERCANONICALID Revoke stated permission for a given amazon user. Permission is one of: read, write, readacp, writeacp, fullcontrol, all"
        },
        {
            "flag": "-D",
            "long": "--restore-days",
            "arg": null,
            "description": "Number of days to keep restored file available (only for 'restore' command). Default is 1 day. --restore-priority=RESTOREPRIORITY Priority for restoring files from S3 Glacier (only for expedited"
        },
        {
            "flag": "",
            "long": "--delete-removed",
            "arg": null,
            "description": "Delete destination objects with no corresponding source file [sync]"
        },
        {
            "flag": "",
            "long": "--no-delete-removed",
            "arg": null,
            "description": "Don't delete destination objects [sync]"
        },
        {
            "flag": "",
            "long": "--delete-after",
            "arg": null,
            "description": "Perform deletes AFTER new uploads when delete-removed is enabled [sync]"
        },
        {
            "flag": "",
            "long": "--delay-updates",
            "arg": null,
            "description": "*OBSOLETE* Put all updated files into place at end [sync] --max-delete=NUM Do not delete more than NUM files. [del] and [sync] --limit=NUM Limit number of objects returned in the response body (only for [ls] and [la] com‐ mands) --add-destination=ADDITIONALDESTINATIONS Additional destination for parallel uploads, in addition to last arg. May be re‐ peated."
        },
        {
            "flag": "",
            "long": "--delete-after-fetch",
            "arg": null,
            "description": "Delete remote objects after fetching to local file (only for [get] and [sync] com‐ mands)."
        },
        {
            "flag": "-p",
            "long": "--preserve",
            "arg": null,
            "description": "Preserve filesystem attributes (mode, ownership, timestamps). Default for [sync] com‐ mand."
        },
        {
            "flag": "",
            "long": "--no-preserve",
            "arg": null,
            "description": "Don't store FS attributes --exclude=GLOB Filenames and paths matching GLOB will be excluded from sync --exclude-from=FILE Read --exclude GLOBs from FILE --rexclude=REGEXP Filenames and paths matching REGEXP (regular expression) will be excluded from sync --rexclude-from=FILE Read --rexclude REGEXPs from FILE --include=GLOB Filenames and paths matching GLOB will be included even if previously excluded by one of --(r)exclude(-from) patterns --include-from=FILE Read --include GLOBs from FILE --rinclude=REGEXP Same as --include but uses REGEXP (regular expression) instead of GLOB --rinclude-from=FILE Read --rinclude REGEXPs from FILE --files-from=FILE Read list of source-file names from FILE. Use - to read from stdin. --region=REGION, --bucket-location=REGION Region to create bucket in. As of now the regions are: us-east-1, us-west-1, us-west-2, eu-west-1, eu- central-1, ap-northeast-1, ap-southeast-1, ap- southeast-2, sa-east-1 --host=HOSTNAME HOSTNAME:PORT for S3 endpoint (default: s3.amazonaws.com, alternatives such as s3-eu- west-1.amazonaws.com). You should also set --host- bucket. --host-bucket=HOSTBUCKET DNS-style bucket+hostname:port template for accessing a bucket (default: %(bucket)s.s3.amazonaws.com) --reduced-redundancy, --rr Store object with 'Reduced redundancy'. Lower per-GB price. [put, cp, mv] --no-reduced-redundancy, --no-rr Store object without 'Reduced redundancy'. Higher per- GB price. [put, cp, mv] --storage-class=CLASS Store object with specified CLASS (STANDARD, STANDARDIA, ONEZONEIA, INTELLI‐ GENTTIERING, GLACIER or DEEPARCHIVE). [put, cp, mv] --access-logging-target-prefix=LOGTARGETPREFIX Target prefix for access logs (S3 URI) (for [cfmodify] and [accesslog] commands)"
        },
        {
            "flag": "",
            "long": "--no-access-logging",
            "arg": null,
            "description": "Disable access logging (for [cfmodify] and [accesslog] commands) --default-mime-type=DEFAULTMIMETYPE Default MIME-type for stored objects. Application default is binary/octet-stream."
        },
        {
            "flag": "-M",
            "long": "--guess-mime-type",
            "arg": null,
            "description": "Guess MIME-type of files by their extension or mime magic. Fall back to default MIME-Type as specified by --default-mime-type option"
        },
        {
            "flag": "",
            "long": "--no-guess-mime-type",
            "arg": null,
            "description": "Don't guess MIME-type and use the default type instead."
        },
        {
            "flag": "",
            "long": "--no-mime-magic",
            "arg": null,
            "description": "Don't use mime magic when guessing MIME-type."
        },
        {
            "flag": "-m",
            "long": "--mime-type",
            "arg": null,
            "description": "Force MIME-type. Override both --default-mime-type and --guess-mime-type. --add-header=NAME:VALUE Add a given HTTP header to the upload request. Can be used multiple times. For in‐ stance set 'Expires' or 'Cache-Control' headers (or both) using this option. --remove-header=NAME Remove a given HTTP header. Can be used multiple times. For instance, remove 'Ex‐ pires' or 'Cache- Control' headers (or both) using this option. [modify]"
        },
        {
            "flag": "",
            "long": "--server-side-encryption",
            "arg": null,
            "description": "Specifies that server-side encryption will be used when putting objects. [put, sync, cp, modify] --server-side-encryption-kms-id=KMSKEY Specifies the key id used for server-side encryption with AWS KMS-Managed Keys (SSE-KMS) when putting objects. [put, sync, cp, modify] --encoding=ENCODING Override autodetected terminal and filesystem encoding (character set). Autodetected: UTF-8 --add-encoding-exts=EXTENSIONs Add encoding to these comma delimited extensions i.e. (css,js,html) when uploading to S3 )"
        },
        {
            "flag": "",
            "long": "--verbatim",
            "arg": null,
            "description": "Use the S3 name as given on the command line. No pre- processing, encoding, etc. Use with caution!"
        },
        {
            "flag": "",
            "long": "--disable-multipart",
            "arg": null,
            "description": "Disable multipart upload on files bigger than --multipart-chunk-size-mb --multipart-chunk-size-mb=SIZE Size of each chunk of a multipart upload. Files bigger than SIZE are automatically up‐ loaded as multithreaded- multipart, smaller files are uploaded using the traditional method. SIZE is in Mega-Bytes, default chunk size is 15MB, minimum allowed chunk size is 5MB, maximum is 5GB."
        },
        {
            "flag": "",
            "long": "--list-md5",
            "arg": null,
            "description": "Include MD5 sums in bucket listings (only for 'ls' command)."
        },
        {
            "flag": "-H",
            "long": "--human-readable-sizes",
            "arg": null,
            "description": "Print sizes in human readable form (eg 1kB instead of 1234). --ws-index=WEBSITEINDEX Name of index-document (only for [ws-create] command) --ws-error=WEBSITEERROR Name of error-document (only for [ws-create] command) --expiry-date=EXPIRYDATE Indicates when the expiration rule takes effect. (only for [expire] command) --expiry-days=EXPIRYDAYS Indicates the number of days after object creation the expiration rule takes effect. (only for [expire] command) --expiry-prefix=EXPIRYPREFIX Identifying one or more objects with the prefix to which the expiration rule applies. (only for [expire] command)"
        },
        {
            "flag": "",
            "long": "--progress",
            "arg": null,
            "description": "Display progress meter (default on TTY)."
        },
        {
            "flag": "",
            "long": "--no-progress",
            "arg": null,
            "description": "Don't display progress meter (default on non-TTY)."
        },
        {
            "flag": "",
            "long": "--stats",
            "arg": null,
            "description": "Give some file-transfer stats."
        },
        {
            "flag": "",
            "long": "--enable",
            "arg": null,
            "description": "Enable given CloudFront distribution (only for [cfmodify] command)"
        },
        {
            "flag": "",
            "long": "--disable",
            "arg": null,
            "description": "Disable given CloudFront distribution (only for [cfmodify] command)"
        },
        {
            "flag": "",
            "long": "--cf-invalidate",
            "arg": null,
            "description": "Invalidate the uploaded filed in CloudFront. Also see [cfinval] command."
        },
        {
            "flag": "",
            "long": "--cf-invalidate-default-index",
            "arg": null,
            "description": "When using Custom Origin and S3 static website, invalidate the default index file."
        },
        {
            "flag": "",
            "long": "--cf-no-invalidate-default-index-root",
            "arg": null,
            "description": "When using Custom Origin and S3 static website, don't invalidate the path to the de‐ fault index file. --cf-add-cname=CNAME Add given CNAME to a CloudFront distribution (only for [cfcreate] and [cfmodify] com‐ mands) --cf-remove-cname=CNAME Remove given CNAME from a CloudFront distribution (only for [cfmodify] command) --cf-comment=COMMENT Set COMMENT for a given CloudFront distribution (only for [cfcreate] and [cfmodify] commands) --cf-default-root-object=DEFAULTROOTOBJECT Set the default root object to return when no object is specified in the URL. Use a relative path, i.e. default/index.html instead of /default/index.html or s3://bucket/default/index.html (only for [cfcreate] and [cfmodify] commands)"
        },
        {
            "flag": "-v",
            "long": "--verbose",
            "arg": null,
            "description": "Enable verbose output."
        },
        {
            "flag": "-d",
            "long": "--debug",
            "arg": null,
            "description": "Enable debug output."
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "Show s3cmd version (2.2.0) and exit."
        },
        {
            "flag": "-F",
            "long": "--follow-symlinks",
            "arg": null,
            "description": "Follow symbolic links as if they are regular files --cache-file=FILE Cache FILE containing local source MD5 values"
        },
        {
            "flag": "-q",
            "long": "--quiet",
            "arg": null,
            "description": "Silence output on stdout --ca-certs=CACERTSFILE Path to SSL CA certificate FILE (instead of system default) --ssl-cert=SSLCLIENTCERTFILE Path to client own SSL certificate CRTFILE --ssl-key=SSLCLIENTKEYFILE Path to client own SSL certificate private key KEYFILE"
        },
        {
            "flag": "",
            "long": "--check-certificate",
            "arg": null,
            "description": "Check SSL certificate validity"
        },
        {
            "flag": "",
            "long": "--no-check-certificate",
            "arg": null,
            "description": "Do not check SSL certificate validity"
        },
        {
            "flag": "",
            "long": "--check-hostname",
            "arg": null,
            "description": "Check SSL certificate hostname validity"
        },
        {
            "flag": "",
            "long": "--no-check-hostname",
            "arg": null,
            "description": "Do not check SSL certificate hostname validity"
        },
        {
            "flag": "",
            "long": "--signature-v2",
            "arg": null,
            "description": "Use AWS Signature version 2 instead of newer signature methods. Helpful for S3-like systems that don't have AWS Signature v4 yet. --limit-rate=LIMITRATE Limit the upload or download speed to amount bytes per second. Amount may be ex‐ pressed in bytes, kilobytes with the k suffix, or megabytes with the m suffix"
        },
        {
            "flag": "",
            "long": "--no-connection-pooling",
            "arg": null,
            "description": "Disable connection re-use"
        },
        {
            "flag": "",
            "long": "--requester-pays",
            "arg": null,
            "description": "Set the REQUESTER PAYS flag for operations"
        },
        {
            "flag": "-l",
            "long": "--long-listing",
            "arg": null,
            "description": "Produce long listing [ls]"
        },
        {
            "flag": "",
            "long": "--stop-on-error",
            "arg": null,
            "description": "stop if error in transfer --content-disposition=CONTENTDISPOSITION Provide a Content-Disposition for signed URLs, e.g., \"inline; filename=myvideo.mp4\" --content-type=CONTENTTYPE Provide a Content-Type for signed URLs, e.g., \"video/mp4\""
        }
    ],
    "examples": [
        "One of the most powerful commands of s3cmd is s3cmd sync used for synchronising complete  di‐",
        "rectory  trees  to  or from remote S3 storage. To some extent s3cmd put and s3cmd get share a",
        "similar behaviour with sync.",
        "Basic usage common in backup scenarios is as simple as:",
        "s3cmd sync /local/path/ s3://test-bucket/backup/",
        "This command will find all files under /local/path directory and copy them  to  corresponding",
        "paths under s3://test-bucket/backup on the remote side.  For example:",
        "/local/path/file1.ext         ->  s3://bucket/backup/file1.ext",
        "/local/path/dir123/file2.bin  ->  s3://bucket/backup/dir123/file2.bin",
        "However  if  the local path doesn't end with a slash the last directory's name is used on the",
        "remote side as well. Compare these with the previous example:",
        "s3cmd sync /local/path s3://test-bucket/backup/",
        "will sync:",
        "/local/path/file1.ext         ->  s3://bucket/backup/path/file1.ext",
        "/local/path/dir123/file2.bin  ->  s3://bucket/backup/path/dir123/file2.bin",
        "To retrieve the files back from S3 use inverted syntax:",
        "s3cmd sync s3://test-bucket/backup/ ~/restore/",
        "that will download files:",
        "s3://bucket/backup/file1.ext         ->  ~/restore/file1.ext",
        "s3://bucket/backup/dir123/file2.bin  ->  ~/restore/dir123/file2.bin",
        "Without the trailing slash on source the behaviour is similar to what has  been  demonstrated",
        "with upload:",
        "s3cmd sync s3://test-bucket/backup ~/restore/",
        "will download the files as:",
        "s3://bucket/backup/file1.ext         ->  ~/restore/backup/file1.ext",
        "s3://bucket/backup/dir123/file2.bin  ->  ~/restore/backup/dir123/file2.bin",
        "All  source file names, the bold ones above, are matched against exclude rules and those that",
        "match are then re-checked against include rules to see whether they  should  be  excluded  or",
        "kept in the source list.",
        "For  the purpose of --exclude and --include matching only the bold file names above are used.",
        "For instance only path/file1.ext is tested against the patterns, not /local/path/file1.ext",
        "Both --exclude and --include work with shell-style wildcards (a.k.a. GLOB).   For  a  greater",
        "flexibility  s3cmd  provides  Regular-expression  versions  of  the two exclude options named",
        "--rexclude and --rinclude.  The options with ...-from suffix (eg  --rinclude-from)  expect  a",
        "filename as an argument. Each line of such a file is treated as one pattern.",
        "There  is  only  one set of patterns built from all --(r)exclude(-from) options and similarly",
        "for include variant. Any file excluded with eg --exclude can be put back with a pattern found",
        "in --rinclude-from list.",
        "Run s3cmd with --dry-run to verify that your rules work as expected.  Use together with --de‐‐",
        "bug get detailed information about matching file names against exclude and include rules.",
        "For example to exclude all files with \".jpg\" extension except those beginning with  a  number",
        "use:",
        "--exclude '*.jpg' --rinclude '[0-9].*.jpg'",
        "To exclude all files except \"*.jpg\" extension, use:",
        "--exclude '*' --include '*.jpg'",
        "To exclude local directory 'somedir', be sure to use a trailing forward slash, as such:",
        "--exclude 'somedir/'"
    ],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Upload, retrieve, and manage data in S3 compatible object storage.",
        "examples": [
            {
                "description": "Invoke configuration/reconfiguration tool",
                "command": "s3cmd --configure"
            },
            {
                "description": "List Buckets/Folders/Objects",
                "command": "s3cmd ls s3://{{bucket|path/to/file}}"
            },
            {
                "description": "Create Bucket/Folder",
                "command": "s3cmd mb s3://{{bucket}}"
            },
            {
                "description": "Download a specific file from a bucket",
                "command": "s3cmd get s3://{{bucket_name}}/{{path/to/file}} {{path/to/local_file}}"
            },
            {
                "description": "Upload a file to a bucket",
                "command": "s3cmd put {{local_file}} s3://{{bucket}}/{{file}}"
            },
            {
                "description": "Move an object to a specific bucket location",
                "command": "s3cmd mv s3://{{src_bucket}}/{{src_object}} s3://{{dst_bucket}}/{{dst_object}}"
            },
            {
                "description": "Delete a specific object",
                "command": "s3cmd rm s3://{{bucket}}/{{object}}"
            }
        ]
    }
}