lines - Output only the given lines of the input stream



NAME

lines - Output only the given lines of the input stream


SYNOPSIS

lines [RANGES [RANGES [...]]] [-- FILE [FILE [...]] | < FILE]


DESCRIPTION

Read from from FILEs if specified, STDIN otherwise. RANGES is comma-delimited list of line numbers and inclusive ranges. Special word "EOF" in a range's upper limit represents the end of the file.

Starts the line numbering from 1.

If multiple files are given, restart the line numbering on each file.

Always displays the lines in the in-file order, not in arguments-order, how they were given in RANGES arguments; ie. does not buffer or seek in the input files. So lines 1,2 and lines 2,1 both display the 1st line before the 2nd.


EXAMPLES

lines 1
lines 2-10
lines 1,5-10 3
lines 2-4 6,8 10-EOF


EXIT STATUS

Exit 2 if there was a range which was not found, ie. a file had less lines than requested.

 lines - Output only the given lines of the input stream