Scroll to navigation

CHOOSE(1) User Commands CHOOSE(1)

NAME

choose - human-friendly and fast alternative to cut and awk

SYNOPSIS

choose [FLAGS] [OPTIONS] <choices>...

DESCRIPTION

choose is a terse field selection tool similar to Python's list slices. It is not meant to be a drop-in replacement for awk or cut, but rather a simple and intuitive tool to reach for when the basics of awk or cut will do, but the overhead of getting them to behave should not be necessary.

It features a simple syntax, negative indexing from the end of the line, zero-indexing, reverse ranges, and regular expression field separators using Rust's regex syntax.

OPTIONS

Choose fields by character number.
Activate debug mode.
Use exclusive ranges, similar to array indexing in many programming languages.
Use non-greedy field separators.
Specify field separator other than whitespace, using Rust regex syntax.
Read from <input> file instead of standard input.
Specify output field separator.
Prints help information.
Prints version information.

ARGUMENTS

<choices>...
Fields to print. Either a, a:b, a..b, or a..=b, where a and b are integers.

The beginning or end of a range can be omitted, resulting in including the beginning or end of the line, respectively. a:b is inclusive of b (unless overridden by -x). a..b is exclusive of b and a..=b is inclusive of b.

EXAMPLES

Print the 5th item from a line (zero indexed).
Print the 0th, 3rd, and 5th item from a line, where items are separated by ':' instead of whitespace.
Print everything from the 2nd to 5th item on the line, inclusive of the 5th.
Print everything from the 2nd to 5th item on the line, exclusive of the 5th.
Print the beginning of the line to the 3rd item.
Print the beginning of the line to the 3rd item, exclusive.
Print the third item to the end of the line.
Print the last item from a line.
Print the last three items from a line.

AUTHOR

Ryan Geary <rtgnj42@gmail.com>

This manual page was written by Ching He <heqing@rool.me> for the Debian project (and may be used by others).

2026-06-11 choose