Skip to content

Instantly share code, notes, and snippets.

@jimarnold
Created September 6, 2012 15:47
Show Gist options
  • Save jimarnold/3657634 to your computer and use it in GitHub Desktop.
Save jimarnold/3657634 to your computer and use it in GitHub Desktop.
reverse truncate a file
Reverse-truncate a file, leaving the last 100 lines intact:
sed -i '' '1,100d' FILENAME
or with backups:
sed -i .bak '1,100d' FILENAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment