Top "Sed" questions

Sed (Stream EDitor) is a command line editor for POSIX environment.

How to replace a path with another path in sed?

I have a csh script (although I can change languages if it has any relevance) where I have to: sed …

path sed csh
sed or awk: delete n lines following a pattern

How would I mix patterns and numeric ranges in sed (or any similar tool - awk for example)? What I …

unix sed awk
How to remove the lines which appear on file B from another file A?

I have a large file A (consisting of emails), one line for each mail. I also have another file B …

linux shell sed diff grep
how to merge two files consistently line by line

I have two files (file1.txt & file2.txt ) , files are only examples . How to merge the two files , in …

linux perl sed awk ksh
Remove part of path on Unix

I'm trying to remove part of the path in a string. I have the path: /path/to/file/drive/file/…

shell unix scripting sed
Easiest way to extract the urls from an html page using sed or awk only

I want to extract the URL from within the anchor tags of an html file. This needs to be done …

html regex bash sed awk
How do I delete all lines in a file starting from after a matching line?

I have a file which is made up of several lines of text: The first line The second line The …

linux bash sed
Replace whole line when match found with sed

I need to replace the whole line with sed if it matches a pattern. For example if the line is …

shell replace sed match
sed error: "invalid reference \1 on `s' command's RHS"

I run several substitution commands as the core of a colorize script for maven. One of the sed commands uses …

regex sed substitution
how to use sed, awk, or gawk to print only what is matched?

I see lots of examples and man pages on how to do things like search-and-replace using sed, awk, or gawk. …

regex unix sed awk gawk