AT&T UNIX™PC Unix System V Users Manual - tenox
AT&T UNIX™PC Unix System V Users Manual - tenox AT&T UNIX™PC Unix System V Users Manual - tenox
CUT ( 1 ) CUT(l) NAME cut - cut out selected fields of each line of a file SYNOPSIS cut -c list [ file! file2 ... ] cut -flist [-d char ] [-s] [ filel file2 .. . ] DESCRIPTION Use cut to cut out columns from a table or fields from each line of a file; in data base parlance, it implements the proj ection of a relation. The fields as specified by liBt can be fixed length, i.e., character positions as on a punched card ( -c option), or the length can vary from line to line and be marked with a field delimiter character like tab ( -f option). Cut can be used as a filter; if no files are given, the standard input is used. The meanings of the options are: liBt A comma-separated list of integer field numbers (in increasing order), with optional - to indicate ranges as in the -o option of nroff/troff for page ranges; e.g., 1,4,7; 1-3,8; -5,10 (short for 1-5,10); or 3- (short for third through last field) . -cliBt The liBt following -c (no space) specifies character positions (e.g., -c1-72 would pass the first 72 characters of each line). -f liBt The liBt following -f is a list of fields assumed to be separated in the file by a delimiter character (see -d ); e.g. , -f1 ,7 copies the first and seventh field only. Lines with no field delimiters will be passed through intact (useful for table subheadings), unless -s is specified. -d char The character following -d is the field delimiter ( -f option only). Default is tab . Space or other characters with special meaning to the shell must be quoted. -s Suppresses lines with no delimiter characters in case of -f option. Unless specified, lines with no delimiters will be passed through untouched. Either the -c or -f option must be specified. HINTS Use grep(l) to make horizontal "cuts" (by context) through a file, or pa8te(l) to put files together column-wise (i.e., horizontally). To reorder columns in a table, use cut and pa8te . EXAMPLES cut -d: -fl,S /etc/passwd mappmg of user IDs to names name='who am i I cut -fl -d" " ' to set name to current login name. - 1 -
- Page 209: CAL ( 1) CAL(l) NAME cal - print ca
- Page 212 and 213: ' ..
- Page 215 and 216: ;� CC ( l ) cc (1) NAME cc - C co
- Page 217: CC(l) /lib/crts.o /lib/mcrto.o /lib
- Page 221 and 222: CDC ( 1 ) CDC { 1) NAME cdc - chang
- Page 223: CDC (l) CDC (l) SEE ALSO admin( l),
- Page 226 and 227: CFLOW ( 1) CFLOW ( 1) produces the
- Page 228 and 229: CFONT(l) (AT&T UNIX PC only ) CFONT
- Page 231: CHOWN (l) CHOWN ( 1) NAME chown, ch
- Page 234 and 235: .'�
- Page 236 and 237: I I I I I I I I I I I I I I I I I I
- Page 238 and 239: COL(l) COL(l) BUGS Cannot back up m
- Page 240 and 241: COMB(l) COMB(l) FIT..ES s.COMB The
- Page 243 and 244: CP ( 1) CP ( 1) NAME cp, In, mv - c
- Page 245 and 246: CPIO ( 1 ) CPIO ( 1) NAME cpio - co
- Page 247: CPIO ( 1) CPIO ( 1) track of them a
- Page 250 and 251: CPP ( 1) CPP (1) Two special names
- Page 253 and 254: CRYPT { l ) ( Domestic Version Only
- Page 255 and 256: CSPLIT ( 1) CSPLIT (l) NAME csplit
- Page 257 and 258: CU ( lC ) CU ( lC ) NAME cu - call
- Page 259: CU(lC) CU ( lC ) BUGS Cu buffers in
- Page 263 and 264: CW(l) CW {l) NAME cw, checkcw - pre
- Page 265 and 266: CW (l) HINTS CW(l) The options are:
- Page 267 and 268: CXREF ( l ) CXREF ( l ) NAME cxref
- Page 269 and 270: DATE ( l ) DATE ( 1) NAME date - pr
- Page 271 and 272: DC( l ) DC (1) NAME de - desk calcu
- Page 273: DC(l) DC (1) Out of pushdown for to
- Page 276 and 277: DD (1) DD (I) EXAMPLE This command
- Page 278 and 279: DELTA ( I) DELTA (l) FILES If -m is
- Page 280 and 281: � '\, ) -� · n ·�- .
- Page 283 and 284: DIFF ( 1) DIFF(l) NAME diff - diffe
- Page 285: DIFF ( 1 ) DIFF ( 1) When comparing
- Page 289: DIFFMK ( 1) DIFFMK(l) NAME diffmk -
- Page 293: DU ( l ) DU ( l ) NAME du - summari
- Page 296 and 297: DUMP(l) DUMP (l) -z name,number Dum
- Page 299 and 300: ED (1) ED (I) NAME ed, red - text e
- Page 301 and 302: � I ED ( 1) ED (1) 2.3 A one-char
- Page 303 and 304: ED ( 1 ) ED (1) The append command
- Page 305 and 306: ED ( 1 ) ED ( 1) octal, and long li
- Page 307 and 308: ED (l) ED (1) currently-remembered
- Page 309: ENABLE ( I ) ENABLE (!) NAME enable
CUT ( 1 ) CUT(l)<br />
NAME<br />
cut - cut out selected fields of each line of a file<br />
SYNOPSIS<br />
cut -c list [ file! file2 ... ]<br />
cut -flist [-d char ] [-s] [ filel file2 .. . ]<br />
DESCRIPTION<br />
Use cut to cut out columns from a table or fields from each line of<br />
a file; in data base parlance, it implements the proj ection of a relation.<br />
The fields as specified by liBt can be fixed length, i.e., character<br />
positions as on a punched card ( -c option), or the length<br />
can vary from line to line and be marked with a field delimiter<br />
character like tab ( -f option). Cut can be used as a filter; if no<br />
files are given, the standard input is used.<br />
The meanings of the options are:<br />
liBt A comma-separated list of integer field numbers (in<br />
increasing order), with optional - to indicate ranges as in<br />
the -o option of nroff/troff for page ranges; e.g., 1,4,7;<br />
1-3,8; -5,10 (short for 1-5,10); or 3- (short for third<br />
through last field) .<br />
-cliBt The liBt following -c (no space) specifies character positions<br />
(e.g., -c1-72 would pass the first 72 characters of<br />
each line).<br />
-f liBt The liBt following -f is a list of fields assumed to be<br />
separated in the file by a delimiter character (see -d );<br />
e.g. , -f1 ,7 copies the first and seventh field only. Lines<br />
with no field delimiters will be passed through intact<br />
(useful for table subheadings), unless -s is specified.<br />
-d char The character following -d is the field delimiter ( -f<br />
option only). Default is tab . Space or other characters<br />
with special meaning to the shell must be quoted.<br />
-s Suppresses lines with no delimiter characters in case of<br />
-f option. Unless specified, lines with no delimiters will<br />
be passed through untouched.<br />
Either the -c or -f option must be specified.<br />
HINTS<br />
Use grep(l) to make horizontal "cuts" (by context) through a file,<br />
or pa8te(l) to put files together column-wise (i.e., horizontally).<br />
To reorder columns in a table, use cut and pa8te .<br />
EXAMPLES<br />
cut -d: -fl,S /etc/passwd<br />
mappmg of user IDs to<br />
names<br />
name='who am i I cut -fl -d" " ' to set name to current<br />
login name.<br />
- 1 -