Skip to content

Instantly share code, notes, and snippets.

@nad2000
Created August 1, 2013 02:47
Show Gist options
  • Save nad2000/6128038 to your computer and use it in GitHub Desktop.
Save nad2000/6128038 to your computer and use it in GitHub Desktop.
simple way of deleting particular lines from a text file with ed and sed.
# with sed:
sed -i '28d' ~/.ssh/known_hosts
# with ed:
ed -s ~/.ssh/known_hosts <<< $'28d\nw'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment