About 1,150,000 results
Open links in new tab
  1. What is the purpose of -e in sed command? - Unix & Linux Stack …

    Jun 3, 2015 · In your example sed 's/foo/bar/' and sed -e 's/foo/bar/' are equivalent. In both cases s/foo/bar/ is the script that is executed by sed. The second option is more explicit, but that is …

  2. Using sed to find and replace complex string (preferrably with regex)

    Learn how to use sed with regex for complex string replacements in Unix systems.

  3. Using 'sed' to find and replace - Unix & Linux Stack Exchange

    Oct 5, 2014 · sed is the s tream ed itor, in that you can use | (pipe) to send standard streams (STDIN and STDOUT specifically) through sed and alter them programmatically on the fly, …

  4. How can I use sed to replace a multi-line string? - Unix & Linux …

    Aug 16, 2016 · Sed has a set of commands which allow this type of thing. Here is a link to a Command Summary for sed. It is the best one I've found, and got me rolling. However forget …

  5. How do I use variables in a sed command? - Ask Ubuntu

    How do I use variables in a sed command? Ask Question Asked 14 years, 1 month ago Modified 4 years, 11 months ago

  6. sed - How to add a carriage return before every newline? - Unix

    Jan 11, 2017 · If you want to do it with sed, you can insert a carriage return at the end of every line: sed -e 's/$/\r/' file.txt This replaces (s) the zero-size area right before the end of the line …

  7. Understanding Sed command with extended RegExp - Unix

    Jul 31, 2018 · 7 I don't know what you know about sed. In sed (1) you may find: sed - stream editor for filtering and transforming text and: -E, -r, --regexp-extended use extended regular …

  8. How do I substitute only first occurence with sed? - Unix & Linux …

    A new version of GNU sed supports the -z option. Normally, sed reads a line by reading a string of characters up to the end-of-line character (new line or carriage return). The GNU version of …

  9. SED: insert text after the last line? - Unix & Linux Stack Exchange

    Nov 3, 2019 · This sed command inserts a tag to the beginning of a file: sed -i "1s/^/<?php /" file How can I insert something to the end of each file with sed?

  10. Sed to print out the line number - Unix & Linux Stack Exchange

    Jun 20, 2019 · A bit of explanation: sed -n '2,4p' and sed '2,4!d' do the same thing: the first only prints lines between the second and the fourth (inclusive), the latter "deletes" every line except …