Thursday, June 7, 2012

An easier way to top & tail 4GB [Was: What is the largest file I can edit using vim?]

On 07.06.12 08:56, james pruett wrote:
> I have an *.sql file.
> Typically I chop it, but I am tired of chopping it.
> I want to remove the first 10 lines and the last 10 lines of this 4GB file.

$ tail --lines=+11 fred.sql | head --lines=-10

(Tested with /etc/passwd, it cuts at the right line numbers, as far as I
can see.)

Erik

--
"When the only tool you have is a hammer, you tend to treat everything as if
it were a nail."
- Abraham Maslow

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: