cut -c list [file ...]
cut -f list [-d delim] [-s] [file ...]
cut -b list [-n] [file ...]
Writes portions of each line from each file to standard output.
If file is not specified or file is a single dash (-) cut reads from standard input.
list can be in terms of column position or fields delimited by a delim character.
Numbering starts from 1.

list n1 n2,n3,n4 n5 a set of increasing numbers and/or ranges separated by comma or whitespace.
range n1-n2 inclusive.
-n numbers or ranges preceded by a dash selects all fields or columns from 1 to the first number.
n- numbers or ranges followed by a dash selects all fields or columns from the last number to the end of the line.
numbers and ranges may be repeated, overlap, and in any order.
It is not an error to specify fields or columns not present in the input line.

-f list fields separated by the field delimiter character (default: tab)
-d delim field delimiter character default:tab .
-sSuppress lines with no field delimiter. Default: lines with no delimiters are passed through unmodified.
-c list character positions. The field form may be a better choice when processing files containing times, dates or numbers which may contain varying number of characters
-b listbyte positions (will be different from character if multi-byte characters).
-n Do not split multi-byte characters. Characters will only be output if at least one byte is selected, and, after a prefix of zero or more unselected bytes, the rest of the bytes that form the character are selected.

The LANG, LC_ALL and LC_CTYPE environment variables affect cut . see environ, locale.


Extract users' login names and shells from the system passwd file as name:shell pairs (i.e. 1st and 7th columns.:


cut -d : -f 1,7 /etc/passwd

Show the names and login times of the currently logged in users:

dgerman  console  Dec 28 11:26 
samual   ttys000  Dec 30 14:44 
dger     ttys001  Dec 30 14:44 
who | cut -c -9,26-
dgerman  11:26 
samual   14:44 
dger     14:44 

exits returning 0 on success, and >0 if an error occurs.

The Mac OSX darwin BSD version as of 10.5.6 exits
if a copyright symbol (x'A9', © ), left double quote (x'93', “) etc,
B8, D1, C0, CF, C2, D8, D4 is encountered with the message: Illegal byte sequence and a exit status of 0.

This is easily corrected with:
export LC_ALL=C

SEE colrm, paste