Home - Resumé - Up


Name

crop - crop input lines to a maximum width

Synopsis

crop [−w width] [file ...]

Description

Crop copies its input to its output, truncating each line that exceeds a maximum width. Lines shorter than that width are left unchanged; see also pad(1).

The options are as follows:

−w width
Truncate lines that exceed width.

If no width is explicitly specified, and the standard error is connected to a terminal, then crop tries to determine its width, first by querying the terminal driver, and failing that by examining the COLUMNS environment variable. If neither method succeeds, or if the standard error is not a terminal, then width defaults to 80 columns.

Environment

COLUMNS
If the standard error is connected to a terminal, and crop fails cannot obtain the terminal width from the driver, then the value of COLUMNS will be taken as the output width.

Bugs

Crop does not yet understand backspace and tab, or multibyte characters.

See Also

pad(1), tty(4)