cut.1 (1678B)
- .\" utils-std: Collection of commonly available Unix tools
- .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- .\" SPDX-License-Identifier: MPL-2.0
- .Dd 2024-08-24
- .Dt CUT 1
- .Os
- .Sh NAME
- .Nm cut
- .Nd cut each line with selected characters/fields
- .Sh SYNOPSIS
- .Nm
- .Fl b Ar list
- .Op Fl n
- .Op Ar file...
- .Nm
- .Fl c Ar list
- .Op Ar file...
- .Nm
- .Fl f Ar list
- .Op Fl d Ar delim
- .Op Fl s
- .Op Ar file...
- .Sh DESCRIPTION
- .Nm
- reads lines from each each
- .Ar file
- or if unspecified standard input,
- and cuts out bytes
- .Pq Fl b ,
- characters
- .Pq Fl c ,
- or character-delimited fields
- .Pq Fl f .
- .Pp
- The
- .Ar list
- argument is a comma-separated list of 1-based ranges, where:
- .Bl -tag -width _1_2_3_
- .It Ql n-
- Selects from
- .Ql n
- to the end of line.
- .It Ql n
- Selects
- .Ql n
- .It Ql n-m
- Selects from
- .Ql n
- to
- .Ql m .
- .It Ql -m
- Selects from
- start of the line to
- .Ql m .
- .It Ql 1,2,3
- is equivalent to
- .Ql 1-3
- .El
- .Sh OPTIONS
- .Bl -tag -width _d_delim
- .It Fl b Ar list
- Cut bytes based on
- .Ar list .
- .It Fl c Ar list
- Cut codepoints based on
- .Ar list .
- .It Fl d Ar delim
- Set the field delimiter to the character
- .Ar delim ,
- if an empty string is passed, then NULL is used as separator.
- (default:\ \et)
- .It Fl f Ar list
- Cut fields based on
- .Ar list .
- .It Fl n
- Do not split codepoints. (Currently unsupported in this implementation)
- .It Fl s
- Suppress lines with no delimiter characters,
- otherwise whole delimiter-less lines are printed as-is.
- .El
- .Sh EXIT STATUS
- .Ex -std
- .Sh STANDARDS
- Except for the lack of support for
- .Fl n ,
- .Nm
- should be compliant with the
- IEEE Std 1003.1-2024 (“POSIX.1”)
- specification.
- .Sh AUTHORS
- .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me