Linux command
b2-tools 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Authorize account
b2 account authorize [applicationKeyId] [applicationKey]
Upload a file to a bucket
b2 file upload [bucketName] [localFile] [remoteName]
Download a file from a bucket
b2 file download [b2://bucketName/fileName] [localPath]
List files in a bucket
b2 ls [bucketName]
Create a new bucket
b2 bucket create [bucketName] [allPrivate]
Sync a local directory to B2
b2 sync [localDir] b2://[bucketName]/[prefix]
说明
b2-tools (invoked as b2) is the official command-line tool for Backblaze B2 Cloud Storage. It provides file upload, download, sync, and bucket management operations for B2's S3-compatible object storage. The sync command efficiently mirrors local directories to B2, uploading only changed files. B2 provides affordable cloud storage with free egress through Cloudflare's bandwidth alliance.
参数
- account authorize _keyID_ _key_
- Authorize with B2 using application key.
- file upload _bucket_ _local_ _remote_
- Upload a file to a bucket.
- file download _uri_ _local_
- Download a file from B2.
- ls _bucket_
- List files in a bucket.
- bucket create _name_ _type_
- Create a bucket (allPrivate or allPublic).
- bucket delete _name_
- Delete a bucket.
- sync _source_ _destination_
- Synchronize files between local and B2 or between B2 buckets.
- file hide _bucket_ _file_
- Hide a file (soft delete).
FAQ
What is the b2-tools command used for?
b2-tools (invoked as b2) is the official command-line tool for Backblaze B2 Cloud Storage. It provides file upload, download, sync, and bucket management operations for B2's S3-compatible object storage. The sync command efficiently mirrors local directories to B2, uploading only changed files. B2 provides affordable cloud storage with free egress through Cloudflare's bandwidth alliance.
How do I run a basic b2-tools example?
Run `b2 account authorize [applicationKeyId] [applicationKey]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does account authorize _keyID_ _key_ do in b2-tools?
Authorize with B2 using application key.