Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wriglz/72ff35a82d8cd84ab6af5004e70ef66e to your computer and use it in GitHub Desktop.
Save wriglz/72ff35a82d8cd84ab6af5004e70ef66e to your computer and use it in GitHub Desktop.
Remove lines from a text file containing a specific string
# Directly modify file & create a backup
sed -i.bak '/pattern to match/d' ./input_file
# Directly modify file - no backup
sed -i '' '/pattern to match/d' ./infile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment