Cut (Unix)
In computing, codice_1 is a command line utility on Unix and Unix-like operating systems which is used to extract sections from each line of input — usually from a file. It is currently part of the GNU coreutils package and the BSD Base System. Extraction of line segments can typically be done by bytes (codice_2), characters (codice_3), or fields (codice_4) separated by a delimiter (codice_5 — the tab character by default). A range must be provided in each case which consists of one of codice_6, codice_7 codice_8 (codice_6 to the end of the line), or codice_10 (beginning of the  line to codice_11), where N and M are counted from 1 (there is no zeroth value). Since version 6, an error is thrown if you include a zeroth value. Prior to this the value was ignored and assumed to be 1. History. is part of the X/Open Portability Guide since issue 2 of 1987. It was inherited into the first version of POSIX.1 and the Single Unix Specification. It first appeared in AT&T System III UNIX in 1982. The version of codice_1 bundled in GNU coreutils was written by David M. Ihnat, David MacKenzie, and Jim Meyering. The command  is available as a separate package for Microsoft Windows as part of the UnxUtils collection of native Win32 ports of common GNU Unix-like utilities. The command has also been ported to the IBM i operating system. Examples. Assuming a file named "codice_13" containing the lines: To output the fourth through tenth characters of each line: $ cut -c 4-10 file ha:beta To output the fifth field through the end of the line of each line using the colon character as the field delimiter: $ cut -d ":" -f 5- file quux five:six:seven epsilon:zeta:eta:theta :iota:kappa:lambda:mu the quick brown fox jumps over the lazy dog Option codice_5 specified a single character delimiter (in the example above it is a colon) which serves as field separator. Option codice_4 which specifies range of fields included in the output (here fields range from five till the end). Option codice_5 presupposes usage of option codice_4. To output the third field of each line using space as the field delimiter: $ cut -d " " -f 3 file foo:bar:baz:qux:quux one:two:three:four:five:six:seven alpha:beta:gamma:delta:epsilon:zeta:eta:theta:iota :kappa:lambda:mu brown To separate two words having any delimiter: $ line=process.processid $ cut -d "." -f1 «< $line process $ cut -d "." -f2 «< $line processid Syntax. cut [-b list] [-c list] [-f list] [-n] [-d delim] [-s] [file] Flags which may be used include: