V8/usr/man/man1/cut.1
.TH CUT 1
.SH NAME
cut, paste \- rearrange columns of data
.SH SYNOPSIS
.B cut
.BR \-c list
[ file ... ]
.PP
.B cut
.BR \-f list
[
.BR \-d char
] [ file ... ]
.PP
.B paste
[
.B \-s
] [
.BR \-d list
] file ...
.SH DESCRIPTION
.I Cut
selects fields from each line of the
.I files
(standard input default).
In data base parlance, it
projects a relation.
The fields
can be fixed length,
as on a punched card
.RB ( \-c
option), or be marked with a delimiter character
.RB ( \-f
option).
.PP
The meanings of the options follow.
A
.I list
is a comma-separated, increasing
list of integers
with optional \fB\-\fP to indicate ranges, for example
1,3\-5,7.
.TP "\w'\-d\ char\ \ 'u"
.BI \-c list
The
.I list specifies character
positions.
.TP
.BI \-f list
The
.I list
specifies field numbers.
.TP
.BI \-d char
The character
is the delimiter for the
.B \-f
option.
Default is tab.
.TP
.B \-s
Suppress lines with no delimiter characters in case of
.B \-f
option.
Normally such lines pass through untouched.
.PP
.I Paste
concatenates corresponding lines of the input
.I files
and places the result on the standard output.
The file name `\-' refers to the standard input.
Lines are glued together with tab characters,
or with characters taken circularly from an optionally specified
.I list.
The list may contain the special escape sequences
.B \en
(newline),
.B \et
(tab),
.B \e\e
(backslash), and
.B \e0
(empty string, not a null character).
.PP
Option
.B \-s
causes
.I paste
to combine successive lines from one file rather than
corresponding lines from multiple files.
.SH EXAMPLES
.TP
cut \-d: \-f1,3 /etc/passwd
mapping of login names to userids
.TP
NAME=`who am i | cut \-f1 \-d" "`
set NAME
to current login name (subtly different from `getuid')
.TP
ls \(bv paste \- \- \- \-
.PD0
.TP
ls \(bv paste \-s \(fm\-d\et\en\(fm \-
4-column and 2-column file listing
.SH SEE ALSO
grep(1), awk(1), sed(1), pr(1), column(1)
.SH BUGS
.I Cut
should handle disordered lists.
.br
In default of file names,
.I paste
should read the the standard input.