Skip to content

Instantly share code, notes, and snippets.

@antonkratz
Last active March 25, 2019 17:27
Show Gist options
  • Save antonkratz/a73d937a7d1a3e900c963242a6a50183 to your computer and use it in GitHub Desktop.
Save antonkratz/a73d937a7d1a3e900c963242a6a50183 to your computer and use it in GitHub Desktop.
Delete lines in a text file that contain a specific string

Delete all lines in the file myfile that contain the string foobar:

sed -i '/foobar/d' myfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment