Last active
January 22, 2020 16:57
-
-
Save wriglz/72ff35a82d8cd84ab6af5004e70ef66e to your computer and use it in GitHub Desktop.
Remove lines from a text file containing a specific string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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