tuc – drop-in replacement for cut

The GNU Core Utilities or coreutils is a package of GNU software containing implementations for many of the basic tools, such as cat, ls, and rm, which are used on Unix-like operating systems.

Every day, we use many command-line tools to manage our systems, and perform basic tasks. Many of the programs provided by coreutils are staples in our daily life. Over the years, these tools have been updated and ported to other systems, but they still retain many of their original traits.

cut is one of the many utilities included with coreutils. cut writes to standard output selected parts of each line of each input file, or standard input. This lets us extract elements by defining ranges, delimiting characters and bytes. It’s not as widely known as some of its counterparts but it can still be a useful and practical command-line utility. cut doesn’t offer sophisticated field processing, like reordering fields, and handling fields aligned with blank characters.

tuc is a similar tool to cut but offers additional functionality. It allows us to split text or bytes into parts and reassemble them in any order. Parts can be referenced by negative indexes, and delimiters can be any number of characters long. It is particularly strong at extracting data from comma-separated lists.

Help information for the tuc utility


tuc is a more powerful replacement for cut. It’s just reached it’s 1.0.0 release with this release having the regex feature enabled by default for the first time. The developer now provides tuc-lite which is tuc without regex support..

The project provides pre-built binaries for Linux (Ubuntu), macOS, and Windows. But it’s trivial to compile the source code.

Developer: Riccardo Attilio Galli
License: GNU General Public License version 3.0

tuc is written in Rust. Learn Rust with our recommended free books and free tutorials.

For other useful drop-in replacements for coreutils, explore our roundup.

Share your Thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.