About 2,570,000 results
Open links in new tab
  1. sed - Change multiple files - Stack Overflow

    The following command is correctly changing the contents of 2 files. sed -i 's/abc/xyz/g' xaa1 xab1 But what I need to do is to change several such files dynamically and I do not know the file na...

  2. How to use sed to replace only the first occurrence in a file?

    For this sort of task, I normally use a small bash script with sed to re-write the file. How do I get sed to replace just the first occurrence of a string in a file rather than replacing every …

  3. shell - How to delete from a text file, all lines that contain a ...

    How would I use sed to delete all lines in a text file that contain a specific string?

  4. 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

  5. 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...

  6. How to use variables in a command in sed? - Stack Overflow

    How to use variables in a command in sed? Asked 12 years, 1 month ago Modified 2 years, 4 months ago Viewed 201k times

  7. What is the proper way to insert tab in sed? - Stack Overflow

    What is the proper way to insert tab in sed? I'm inserting a header line into a stream using sed. I could probably do a replacement of some character afterward to put in tab using regular …

  8. linux - sed with special characters - Stack Overflow

    The single quotes around the sed body will prevent the shell from substituting any variables, so the $ on the left-hand side is escaped only to prevent its special regular expression meaning.

  9. regex - How to replace a whole line with sed? - Stack Overflow

    sed -i "/aaa=/c\aaa=xxx" your_file_here This will go through and find any lines that pass the aaa= test, which means that the line contains the letters aaa=. Then it replaces the entire line with …

  10. How can I replace each newline (\n) with a space using sed?

    sed works on a "stream" of input, but it comprehends it in newline delimited chunks. It is a unix tool, which means it does one thing very well. The one thing is "work on a file line-wise". Making …