CUT(1)

πŸ“¦ version 1.053, in alpine 3.24

πŸ’– 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:

  • -b list β€” the list specifies byte positions.
  • -c list β€” the list specifies character positions.
  • -d string β€” use the first character of string as the field delimiter character instead of the tab character.
  • -f list β€” 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: cut does not understand multibyte characters. The -c and -b options function identically, and -n does 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. πŸ‘‘

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