chunk

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2023 License: MIT Imports: 8 Imported by: 0

README

chunk

Chunk is a tiny utility for grabbing an arbitrary chunk from a file, given an offset and length.

You'd think that dd would be the right tool, but unfortunately it makes this task quite difficult.

Installation

go install github.com/cespare/chunk@latest

Usage

chunk -h
Usage: ./chunk [OPTIONS] FILENAME OFFSET
where OPTIONS are:
  -end value
        Ending offset
  -len value
        Length of chunk
Exactly one of -end, -len must be given.
Numbers may be written as 1000, 1e3, or 1kB.

Example

$ cat f.txt
foo bar
baz
$ chunk -len 7 f.txt 3
 bar
ba

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL