CUT(1)
π cut(1) β select portions of each line of a file π
okay so this is the User Contributed Perl Documentation cut(1) page, bestie, and it's lowkey iconic. cut is that utility that picks out little pieces of every line and sends them to standard output. main character energy, honestly.
πΈ NAME πΈ
cut β select portions of each line of a file.
π§Ύ SYNOPSIS π§Ύ
cut "-b" list ["-n"] [file ...]
cut "-c" list [file ...]
cut "-f" list ["-d" delim] ["-s"] [file ...]
β¨ DESCRIPTION β¨
So cut selects portions of each line β the portions are specified by list β from each file (or from standard input if you don't pass a file, which is literally the default), and writes them to standard output. The items specified by list can be in terms of column position or in terms of fields delimited by a special character. Column numbering starts from 1, not zero, bestie. π«Ά
list is a comma- or whitespace-separated set of increasing numbers and/or number ranges. A number range consists of a number, a dash (-), and a second number, and it selects the fields or columns from the first number to the second, inclusive. Numbers or number ranges may be preceded by a dash, which selects all fields or columns from 1 to the first number. Numbers or number ranges may be followed by a dash, which selects all fields or columns from the last number to the end of the line. Numbers and number ranges may be repeated, overlapping, and in any order. And no stress: it is not an error to select fields or columns not present in the input line. π
π OPTIONS π
cut accepts the following options:
-blist β the list specifies byte positions.-clist β the list specifies character positions.-dstring β use the first character of string as the field delimiter character instead of the tab character.-flist β the list specifies fields, delimited in the input by a single tab character. Output fields are separated by a single tab character.-nβ do not split multi-byte characters.-sβ suppresses lines with no field delimiter characters. Unless specified, lines with no delimiters are passed through unmodified.
π BUGS π
warning, bestie:cutdoes not understand multibyte characters. The-cand-boptions function identically, and-ndoes nothing. That's the tea β no cap. π
π STANDARDS π
This cut implementation is compatible with the OpenBSD implementation. slay. β¨
π AUTHOR π
The Perl implementation of cut was written by Rich Lafferty, rich@alcor.concordia.ca. credit where credit is due, periodt. π
π COPYRIGHT and LICENSE π
This program is free and open software. You may use, copy, modify, distribute and sell this program (and any modified variants) in any way you wish, provided you do not restrict others to do the same.
okay bye bestie β this page is from perl v5.42.2, dated 2026-02-15, and it's CUT(1); mwah π
π¦ where this page comes from
- alpine 3.24: perl-power-tools-doc 1.053-r1 Β· GPL-2.0-or-later AND Artistic-1.0-Perl AND Artistic-2.0 AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms