
unix - sed edit file in-place - Stack Overflow
How do I edit a file in a single sed command? Currently, I have to manually stream the edited content into a new file and then rename the new file to the original file name. I tried sed -i, but my
shell - "sed" command in bash - Stack Overflow
Oct 21, 2010 · sed is the Stream EDitor. It can do a whole pile of really cool things, but the most common is text replacement. The s,%,$,g part of the command line is the sed command to execute. …
Find and replace with sed in directory and sub directories
I run this command to find and replace all occurrences of 'apple' with 'orange' in all files in root of my site: find ./ -exec sed -i 's/apple/orange/g' {} \\; But it doesn't go through sub directo...
unix - What does sed -i option do? - Stack Overflow
Aug 30, 2013 · I'm debugging a shell script and trying to find out the task performed by the following command: sed -i '1,+999d' /home/org_user/data.txt I need to change this command as its failing with …
How to use variables in a command in sed? - Stack Overflow
How to use variables in a command in sed? Asked 12 years, 6 months ago Modified 2 years, 8 months ago Viewed 202k times
linux - sed with special characters - Stack Overflow
How can I make sed ignore special charactars, I tried adding back slash before special characters, but maybe I got it wrong, can some one show me an example? Here is what i want :
What does \\1 in sed do? - Stack Overflow
Jan 6, 2011 · 42 I found this question really relevant to what I wanted: Parsing using awk or sed in Unix, however I can't figure out what the following does: 's/\([,=]\) /\1/g' I know that g does a global …
sed command to replace multiple spaces into single spaces
May 26, 2017 · I tried to replace multiple spaces in a file to single space using sed. But it splits each and every character like below. Please let me know what the problem is ... $ cat test.txt iiHi Hello Hi
Using different delimiters in sed commands and range addresses
I am using sed in a shell script to edit filesystem path names. Suppose I want to replace /foo/bar with /baz/qux However, sed's s/// command uses the forward slash / as the delimiter. If I do tha...
How can I output only captured groups with sed? - Stack Overflow
Is there a way to tell sed to output only captured groups? For example, given the input: This is a sample 123 text and some 987 numbers And pattern: /([\\d]+)/ Could I get only 123 and 987 output ...