[comp.unix.questions] wanted: utility to extract lines by

kenny@uiucdcsb.cs.uiuc.edu (04/08/88)

/* Written 11:07 am  Apr  6, 1988 by uejio@lll-lcc.aRpA in uiucdcsb:comp.unix.questions */
/* ---------- "wanted: utility to extract lines by" ---------- */
Does anyone know of a utility which will extract the nth line of a
file?
/* End of text from uiucdcsb:comp.unix.questions */

head -n file | tail +m

will isolate lines m-n from file.

Example:
------------------------------------------------------------------------
% cat foo
this
is
a
test
of
extracting
lines
% head -4 foo | tail +3
a
test
------------------------------------------------------------------------
Kevin