cut (Unix)
| cut | |
|---|---|
| Original author | AT&T Bell Laboratories |
| Developers | Various open-source and commercial developers |
| Initial release | February 1985 |
| Operating system | Unix, Unix-like, IBM i |
| Platform | Cross-platform |
| Type | Command |
| License | coreutils: GPLv3+ |
cut is a shell command that extracts sections from each line of input text — 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), 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.