CHOOSE(1)

πŸ“¦ version 1.3.7, in ubuntu stonking

✨ CHOOSE(1) ✨

okay so bestie, welcome to the User Commands section of the manual, and this one is literally the it-girl of the terminal: choose. no cap. sit down, grab a strawberry πŸ“, and let me tell you everything.


🌸 NAME 🌸

choose β€” the human-friendly and fast alternative to cut and awk πŸ’… (yes, really, both of them. iconic behaviour.)


πŸ¦‹ SYNOPSIS πŸ¦‹

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

that's the whole vibe right there. flags, options, and then a pile of choices. periodt. ✨


πŸ’– DESCRIPTION πŸ’–

okay so choose is a terse field selection tool, and "terse" is doing a LOT of work in that sentence β€” it works like Python's list slices, which honestly? a serve. πŸŽ€

it is not meant to be a drop-in replacement for awk or cut, bestie, don't come for me β€” it's just a simple and intuitive little tool you reach for when the basics of awk or cut will do, but the overhead of getting them to behave should not be necessary. 😌 like, you could fight with awk for twenty minutes, or you could just... not.

it features:

  • a simple syntax 🌈
  • negative indexing from the end of the line πŸ¦‹
  • zero-indexing (yes babe, we start at 0, that's the law) πŸ‘‘
  • reverse ranges πŸ”₯
  • regular expression field separators using Rust's regex syntax ✨

it's giving "small tool, huge personality," fr fr.


πŸ’… OPTIONS πŸ’…

  • -c, --character-wise β€” choose fields by character number 🧚
  • -d, --debug β€” activate debug mode πŸ” (for when you need to see what's actually happening, iykyk)
  • -x, --exclusive β€” use exclusive ranges, similar to array indexing in many programming languages πŸ‘€
  • -n, --non-greedy β€” use non-greedy field separators βœ‚οΈ
  • -f, --field-separator <field-separator> β€” specify a field separator other than whitespace, using Rust regex syntax πŸŽ€
  • -i, --input <input> β€” read from the <input> file instead of standard input πŸ“‚
  • -o, --output-field-separator <output-field-separator> β€” specify output field separator 🫢
  • -h, --help β€” prints help information πŸ†˜
  • -V, --version β€” 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, which results in including the beginning or end of the line, respectively 🌸 (so like, no left number = start from the very top of the line, no right number = ride it all the way to the end)

and now the part everyone gets wrong, so listen up:

  • a:b is inclusive of b β€” unless overridden by -x 🚨
  • a..b is exclusive of b πŸ™ˆ
  • a..=b is inclusive of b ✨

πŸ”₯ EXAMPLES πŸ”₯

the moment you've all been waiting for. πŸŽ€

  • choose 5 print the 5th item from a line (zero indexed). πŸ‘‘
  • choose -f ':' 0 3 5 print the 0th, 3rd, and 5th item from a line, where items are separated by ':' instead of whitespace. πŸ“
  • choose 2:5 print everything from the 2nd to 5th item on the line, inclusive of the 5th. πŸ’–
  • choose -x 2:5 print everything from the 2nd to 5th item on the line, exclusive of the 5th. βœ‚οΈ
  • choose :3 print the beginning of the line to the 3rd item. 🌈
  • choose -x :3 print the beginning of the line to the 3rd item, exclusive. πŸ™ˆ
  • choose 3: print the third item to the end of the line. πŸ¦‹
  • choose -1 print the last item from a line. πŸ’…
  • choose -3:-1 print the last three items from a line. πŸ‘‘πŸ’œ

🌈 AUTHOR 🌈

Ryan Geary <rtgnj42@gmail.com> β€” the icon who made this 🫢

this manual page was written by Ching He <heqing@rool.me> for the Debian project (and may be used by others). πŸ’– giving credit where credit is due, as one does.


bestie reminder: this page is choose, from User Commands, and the version/date tag on the bottom of the original is 2026-06-11. so when you cite it, cite it cute. πŸ’…βœ¨

xoxo, go slice some fields, you absolute main character πŸŒΈπŸ¦‹πŸ’œ

πŸ“¦ where this page comes from