← 返回命令列表

Linux command

azcopy 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

Copy a local file

azcopy copy [path/to/file] "https://[account].blob.core.windows.net/[container]/[blob]?[SAS_token]"

Download a blob

azcopy copy "https://[account].blob.core.windows.net/[container]/[blob]?[SAS_token]" [path/to/destination]

Sync a local directory

azcopy sync [path/to/directory] "https://[account].blob.core.windows.net/[container]?[SAS_token]"

Copy between storage accounts

azcopy copy "https://[source].blob.core.windows.net/[container]?[SAS]" "https://[dest].blob.core.windows.net/[container]?[SAS]" --recursive

Copy with pattern matching

azcopy copy "https://[account].blob.core.windows.net/[container]/*.txt?[SAS]" [path/to/destination]

List blobs

azcopy list "https://[account].blob.core.windows.net/[container]?[SAS_token]"

Login with Azure AD

azcopy login

Show transfer jobs

azcopy jobs list

说明

AzCopy is a command-line utility for high-performance data transfer to and from Azure Blob Storage, Azure Files, and Azure Data Lake Storage. It uses parallel connections and automatic retry logic for reliable transfers. AzCopy supports copying between local filesystems and Azure storage, between Azure storage accounts, and to/from AWS S3. Authentication can use SAS tokens, Azure AD, or service principals. The sync command provides one-way synchronization, copying only new or modified files. Copy operations can preserve metadata, access tiers, and handle recursive directory structures.

参数

copy
Copy files or blobs between locations.
sync
Synchronize source to destination.
list
List blobs or files.
login
Authenticate with Azure AD.
logout
Clear cached credentials.
jobs list
Show transfer jobs.
jobs show
Get details of a specific job.
jobs resume
Resume a failed transfer.
remove
Delete blobs or files.
--recursive
Include subdirectories.
--include-pattern _pattern_
Include files matching pattern.
--exclude-pattern _pattern_
Exclude files matching pattern.
--overwrite _mode_
true, false, prompt, or ifSourceNewer.
--preserve-smb-permissions
Preserve Windows ACLs.
--block-size-mb _size_
Block size for uploads.
--cap-mbps _rate_
Limit transfer rate.
--dry-run
Show what would be transferred.
--log-level _level_
Logging verbosity.

FAQ

What is the azcopy command used for?

AzCopy is a command-line utility for high-performance data transfer to and from Azure Blob Storage, Azure Files, and Azure Data Lake Storage. It uses parallel connections and automatic retry logic for reliable transfers. AzCopy supports copying between local filesystems and Azure storage, between Azure storage accounts, and to/from AWS S3. Authentication can use SAS tokens, Azure AD, or service principals. The sync command provides one-way synchronization, copying only new or modified files. Copy operations can preserve metadata, access tiers, and handle recursive directory structures.

How do I run a basic azcopy example?

Run `azcopy copy [path/to/file] "https://[account].blob.core.windows.net/[container]/[blob]?[SAS_token]"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does copy do in azcopy?

Copy files or blobs between locations.