Skip to main content
# B2 Command Line Tool

| Status |
| :------------ |
| [![Travis CI](https://img.shields.io/travis/Backblaze/B2_Command_Line_Tool/master.svg?label=Travis%20CI)](https://travis-ci.org/Backblaze/B2_Command_Line_Tool) |
| [![License](https://img.shields.io/pypi/l/b2.svg?label=License)](https://pypi.python.org/pypi/b2) |
| [![python versions](https://img.shields.io/pypi/pyversions/b2.svg?label=python versions)](https://pypi.python.org/pypi/b2) |
| [![PyPI version](https://img.shields.io/pypi/v/b2.svg?label=PyPI version)](https://pypi.python.org/pypi/b2) |

The command-line tool that gives easy access to all of the capabilities of B2 Cloud Storage.

This program provides command-line access to the B2 service.

Version 0.5.4

# Installation

This tool can be installed with:

pip install b2

If you see a message saying that the `six` library cannot be installed, which
happens if you're installing with the system python on OS X El Capitan, try
this:

pip install --ignore-installed b2

# Usage

b2 authorize_account [<accountId>] [<applicationKey>]
b2 cancel_all_unfinished_large_files <bucketName>
b2 cancel_large_file <fileId>
b2 clear_account
b2 create_bucket <bucketName> [allPublic | allPrivate]
b2 delete_bucket <bucketName>
b2 delete_file_version <fileName> <fileId>
b2 download_file_by_id [--noProgress] <fileId> <localFileName>
b2 download_file_by_name [--noProgress] <bucketName> <fileName> <localFileName>
b2 get_file_info <fileId>
b2 help [commandName]
b2 hide_file <bucketName> <fileName>
b2 list_buckets
b2 list_file_names <bucketName> [<startFileName>] [<maxToShow>]
b2 list_file_versions <bucketName> [<startFileName>] [<startFileId>] [<maxToShow>]
b2 list_parts <largeFileId>
b2 list_unfinished_large_files <bucketName>
b2 ls [--long] [--versions] <bucketName> [<folderName>]
b2 make_url <fileId>
b2 sync [--delete] [--keepDays N] [--skipNewer] [--replaceNewer] \
[--threads N] [--noProgress] <source> <destination>
b2 update_bucket <bucketName> [allPublic | allPrivate]
b2 upload_file [--sha1 <sha1sum>] [--contentType <contentType>] [--info <key>=<value>]* \
[--noProgress] [--threads N] <bucketName> <localFilePath> <b2FileName>
b2 version

For more details on one command: b2 help <command>

# Contrib

## bash completion

You can find a [bash completion](https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html#Programmable-Completion)
script in the `contrib` directory. See [this](doc/bash_completion.md) for installation instructions.

# Developer Info

You'll need to have these packages installed:

* nose
* pyflakes
* six
* yapf

There is a Makefile with a rule to run the unit tests using the currently active Python:

make test

To test in multiple python virtual environments, set the enviroment variable PYTHON_VIRTUAL_ENVS
to be a space-separated list of their root directories. When set, the makefile will run the
unit tests in each of the environments.

Before checking in, use the pre-commit.sh script to check code formatting, run
unit tests, and run integration tests.

The integration tests need a file in your home directory called `.b2_auth`
that contains two lines with nothing on them but your account ID and application key:

accountId
applicationKey

Metadata

Release files for b2 0.5.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for b2 0.5.4
File Size Uploaded Provenance Actions
b2-0.5.4.tar.gz 59.4 kB Without provenance Details for b2-0.5.4.tar.gz

Release files / b2-0.5.4.tar.gz

Download URL b2-0.5.4.tar.gz
Size 59.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4d793fde4080617c0d2173b04ec20dc968ab1ca794768cc1b5e597f7392032d6
BLAKE2b-256 checksum
How to use checksums
7efbfcad53a9cf92a3cf6c9b4e4254bebe19a868831f4df049aacb042c2d8c28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for b2 0.5.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.4 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page