cut.1 (1495B)
1 .Dd 2015-10-08 2 .Dt CUT 1 3 .Os sbase 4 .Sh NAME 5 .Nm cut 6 .Nd extract columns of data 7 .Sh SYNOPSIS 8 .Nm 9 .Fl b Ar list 10 .Op Fl n 11 .Op Ar file ... 12 .Nm 13 .Fl c Ar list 14 .Op Ar file ... 15 .Nm 16 .Fl f Ar list 17 .Op Fl d Ar delim 18 .Op Fl s 19 .Op Ar file ... 20 .Sh DESCRIPTION 21 .Nm 22 out bytes, characters or delimited fields from each line of 23 .Ar file 24 and write to stdout. 25 .Pp 26 If no 27 .Ar file 28 is given or 29 .Ar file 30 is '-', 31 .Nm 32 reads from stdin. 33 .Pp 34 .Ar list 35 is a comma or space separated list of numbers and ranges starting 36 from 1. Ranges have the form 'N-M'. If N or M is missing, 37 beginning or end of line is assumed. Numbers and ranges 38 may be repeated, overlapping and in any order. 39 .Pp 40 Selected input is written in the same order it is read 41 and is written exactly once. 42 .Sh OPTIONS 43 .Bl -tag -width Ds 44 .It Fl b Ar list | Fl c Ar list 45 .Ar list 46 specifies byte | character positions. 47 .It Fl d Ar delim 48 Use 49 .Ar delim 50 as field delimiter, which can be an arbitrary string. Default is '\et'. 51 .It Fl f Ar list 52 .Ar list 53 specifies field numbers. Lines not containing field 54 delimiters are passed through, unless 55 .Fl s 56 is specified. 57 .It Fl n 58 Do not split multibyte characters. A character is written when its 59 last byte is selected. 60 .It Fl s 61 Suppress lines not containing field delimiters. 62 .El 63 .Sh STANDARDS 64 The 65 .Nm 66 utility is compliant with the 67 .St -p1003.1-2013 68 specification. 69 .Pp 70 The possibility of separating numbers and ranges with a space and specifying 71 multibyte delimiters of arbitrary length is an extension to that specification.