Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add s2 commandline tools #160

Merged
merged 2 commits into from
Sep 14, 2019
Merged

Add s2 commandline tools #160

merged 2 commits into from
Sep 14, 2019

Conversation

klauspost
Copy link
Owner

@klauspost klauspost commented Sep 12, 2019

Commandline tools

Some very simply commandline tools are provided; s2c for compression and s2d for decompression.

Installing then requires Go to be installed. To install them, use:

go install github.com/klauspost/compress/s2/cmd/s2c && go install github.com/klauspost/compress/s2/cmd/s2d

To build binaries to the current folder use:

go build github.com/klauspost/compress/s2/cmd/s2c && go build github.com/klauspost/compress/s2/cmd/s2d

s2c

Usage: s2c [options] file1 file2
Compresses all files supplied as input separately. 
Output files are written as 'filename.ext.s2'.
By default output files will be overwritten.
Use - as the only file name to read from stdin and write to stdout.
Wildcards are accepted: testdir/*.txt will compress all files in testdir ending with .txt
Directories can be wildcards as well. testdir/*/*.txt will match testdir/subdir/b.txt
Options:
  -blocksize string
        Max  block size. Examples: 64K, 256K, 1M, 4M. Must be power of two and <= 4MB (default "1M")
  -c    Write all output to stdout. Multiple input files will be concatenated.
  -cpu int
        Compress using this amount of threads (default Auto)
  -faster
        Compress faster, but with a minor compression loss
  -help
        Display help
  -pad string
        Pad size to a multiple of this value, Examples: 64K, 256K, 1M, 4M, etc (default "1")
  -safe
        Do not overwrite output files

s2d

Usage: s2d [options] file1 file2
Decompresses all files supplied as input. Input files must end with '.s2' or '.snappy'.
Output file names have the extension removed. By default output files will be overwritten.
Use - as the only file name to read from stdin and write to stdout.
Wildcards are accepted: testdir/*.txt will compress all files in testdir ending with .txt
Directories can be wildcards as well. testdir/*/*.txt will match testdir/subdir/b.txt
Options:
  -c    Write all output to stdout. Multiple input files will be concatenated.
  -help
        Display help
  -safe
        Do not overwrite output files

@klauspost klauspost merged commit 72edc79 into master Sep 14, 2019
@klauspost klauspost deleted the add-s2-commandline-tools branch September 14, 2019 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant