Last active
July 15, 2024 03:18
-
-
Save Sardonyx001/6c820ef26d4f452c667411cd976d0f2e to your computer and use it in GitHub Desktop.
Sed cheatsheet
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
# Removes all lines containing `string` from input.txt and prints the result to STDIN | |
sed '/string/d' input.txt | |
# Overwrites the file with the modification | |
sed '/string/d' input.txt > input.txt | |
# Overrite inplace (Doens't work wth GNU sed, only MacOS & BSD sed) | |
sed -i '' '/string/d' input.txt | |
# GNU sed version | |
sed -i '/string/d' input.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment