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