1 reference results for: Cut (Unix)
Wikipedia
In computing, cut is a Unix command line utility which is used to extract sections from each line of input — usually from a file.
Extraction of line segments can typically be done by bytes (-b), characters (-c), or fields (-f) separated by a delimiter (-d — the tab character by default). A range must be provided in each case which consists of one of N, N-M, N- (N to the end of the line), or -M (beginning of the line to M).
Examples
Assuming a file named a containing the lines:
foo:bar:baz:qux:quux
one:two:three:four:five:six:seven
alpha:beta:gamma:delta:epsilon:zeta:eta:teta:iota:kappa:lambda:mu
To output the fourth through tenth characters of each line:
% cut -c 4-10 a
This gives the output:
:bar:ba
:two:th
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- a
This gives the output:
quux
five:six:seven
epsilon:zeta:eta:teta:iota:kappa:lambda:mu
See also
External links
Wikipedia, the free encyclopedia © 2001-2006 Wikipedia contributors (Disclaimer)
This article is licensed under the GNU Free Documentation License.
Last updated on Friday July 18, 2008 at 06:13:08 PDT (GMT -0700)
View this article at Wikipedia.org - Edit this article at Wikipedia.org - Donate to the Wikimedia Foundation
This article is licensed under the GNU Free Documentation License.
Last updated on Friday July 18, 2008 at 06:13:08 PDT (GMT -0700)
View this article at Wikipedia.org - Edit this article at Wikipedia.org - Donate to the Wikimedia Foundation
Copyright © 2008, Dictionary.com, LLC. All rights reserved.











