About 2,630,000 results
Open links in new tab
  1. 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

  2. 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 …

  3. linux - sed with special characters - Stack Overflow

    sed with special characters Asked 14 years, 6 months ago Modified 2 years, 11 months ago Viewed 90k times

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

    Use this solution with GNU sed: sed ':a;N;$!ba;s/\n/ /g' file This will read the whole file in a loop (':a;N;$!ba), then replaces the newline (s) with a space (s/\n/ /g). Additional substitutions can …

  5. awk - remove ^M character from file using sed - Stack Overflow

    I have this line inside a file: ULNET-PA,client_sgcib,broker_keplersecurities ,KEPLER I want to get rid of the carriage return character, ^M. I've tried: sed 's/^M//g' However, this removes ^M and

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

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

  8. 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, 3 months ago Viewed 200k times

  9. Boolean OR in sed regex - Stack Overflow

    Feb 11, 2013 · I'm trying to replace all references of a package named boots in a configuration file. The line format is add fast (package OR pkg) boots-(any-other-text), e.g.: add fast …

  10. sed - Add text at the end of each line - Stack Overflow

    211 You could try using something like: sed -n 's/$/:80/' ips.txt > new-ips.txt Provided that your file format is just as you have described in your question. The s/// substitution command matches …