ock

Crates.ioock
lib.rsock
version0.1.1
created_at2022-11-20 15:41:38.958972+00
updated_at2025-09-08 19:38:09.274568+00
descriptionA simple, fast command line utility for working with table-like data
homepage
repositoryhttps://github.com/williamwmarx/ock
max_upload_size
id719174
size149,711
William W. Marx (williamwmarx)

documentation

README

ock

Crates.io License: MIT CI

ock is a lightweight command-line tool for slicing tabular data. It covers many everyday awk tasks with a simpler, faster interface.

The project started as an effort to learn Rust and forget awk. It became useful enough for me and I stopped maintaining it. Now, thanks to the fine folks at Anthropic and OpenAI making the cost of code maintenance ~zero, the project is back under active development.

Features

  • Select columns by index or header
  • Slice rows and columns with Python-like ranges
  • Filter using regular expressions
  • Work with custom row and column delimiters

Installation

From crates.io

cargo install ock

Using cargo-binstall

cargo binstall ock

Pre-built binaries

Download pre-built binaries for your platform from the releases page.

Available for:

  • Linux (x86_64, aarch64)
  • macOS (x86_64, Apple Silicon)
  • Windows (x86_64)

Usage

Select columns

ps aux | ock -c pid,command          # by header
ps aux | ock -c 1,3                  # by index

Slice rows

ps aux | ock -c pid -r 0:10          # first ten rows
ps aux | ock -r -5:                  # last five rows

Filter with regex

ps aux | ock -r 'python(2|3)'        # rows matching a pattern
ps aux | ock -c '/^pid|cmd$/'        # columns by regex

Custom delimiters

ock -r 1:10 -c 1,5 --column-delimiter ',' data.csv

Combine operations

ps aux | ock -c pid,command -r 'python'

Out-of-bounds selections produce a warning and no output.

License

MIT license. See LICENSE for details.

Commit count: 109

cargo fmt