CUT(1) | General Commands Manual | CUT(1) |
cut
— cut each
line with selected characters/fields
cut |
-b list
[-n ] [file...] |
cut |
-c list
[file...] |
cut |
-f list
[-d delim]
[-s ] [file...] |
cut
reads lines from each each
file or if unspecified standard input, and cuts out
bytes (-b
), characters (-c
),
or character-delimited fields (-f
).
The list argument is a comma-separated list of 1-based ranges, where:
n-
’n
’ to the end of
line.n
’n
’n-m
’n
’ to
‘m
’.-m
’m
’.1,2,3
’1-3
’-b
list-c
list-d
delim-f
list-n
-s
The cut
utility exits 0 on success,
and >0 if an error occurs.
Except for the lack of support for -n
,
cut
should be compliant with the IEEE Std
1003.1-2024 (“POSIX.1”) specification.
Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
2024-08-24 | Linux 6.6.67-gentoo-x86_64 |