Assuming the file isn't excessively large (e.g. several GB or so), piping from one to the next is as efficient as you'll get, short of writing your own program to do so.
head ... file | tail ...
(Or the other way around. Whichever.)
Assuming the file isn't excessively large (e.g. several GB or so), piping from one to the next is as efficient as you'll get, short of writing your own program to do so.
head ... file | tail ...
(Or the other way around. Whichever.)