Delete all but the last 1000 lines of file

$ ex -c '1,$-1000d' -c 'wq' file

commandlinefu.com

Diff your entire server config at ScriptRock.com

Read More here.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.