Created
November 22, 2011 18:55
-
-
Save jgyllen/1386534 to your computer and use it in GitHub Desktop.
sed commands
This file contains hidden or 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
# Find rows containing string 'foo' in file bar.txt | |
$ sed -n '/foo/p' < bar.txt | |
# Replace occurrences of 'foo' with 'bar' in baz.txt and backup original to baz.txt.bak | |
$ sed -i.bak -e 's%foo%bar%' baz.txt | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment