If you just want to have a look at a file, use less.
If you need cut out a specific part of the file, do this (within less):
Go to the 1st page you're interested in
Press the keys m and a - this means: mark position a.
Go to the last position of the file you're interested in
Press the keys | (pipe) and a - this means: pipe everything between here and position a to a command
Type in the command you want the data to be sent to. If you want to copy this data into the editor buffer, just use vim -
as command (the minus sign as filename means file to be edited is to be read from stdin).
If you know that you will need all data from a specific position on up to the end of the file you may also do this:
Go to the 1st page you're interested in
Press the keys | (pipe) and $ - this means: pipe everything between here and the end of the file to a command
Type in the command you want the data to be sent to (e.g. cat >/tmp/myfile
or vim -
).
1I did not know
less
could do this. Thanks :) – icedwater – 2013-09-05T05:01:05.410