Top "Sed" questions

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

find difference between two text files with one item per line

I have two files: file 1 dsf sdfsd dsfsdf file 2 ljljlj lkklk dsf sdfsd dsfsdf I want to display what is …

bash file scripting sed awk
How to remove trailing whitespaces with sed?

I have a simple shell script that removes trailing whitespace from a file. Is there any way to make this …

sed whitespace
Using sed, how do you print the first 'N' characters of a line?

Using sed what is an one liner to print the first n characters? I am doing the following: grep -G …

shell sed grep
How to use sed to extract substring

I have a file containing the following lines: <parameter name="PortMappingEnabled" access="readWrite" type="xsd:boolean"></parameter&…

linux shell ubuntu xml-parsing sed
In Bash, how do I add a string after each line in a file?

How do I add a string after each line in a file using bash? Can it be done using the …

linux bash unix sed
How to add to the end of lines containing a pattern with sed or awk?

Here is example file: somestuff... all: thing otherthing some other stuff What I want to do is to add to …

bash sed awk
How to select lines between two marker patterns which may occur multiple times with awk/sed

Using awk or sed how can I select lines which are occurring between two different marker patterns? There may be …

shell unix sed awk pattern-matching
Using sed to mass rename files

Objective Change these filenames: F00001-0708-RG-biasliuyda F00001-0708-CS-akgdlaul F00001-0708-VF-hioulgigl to these filenames: F0001-0708-RG-biasliuyda F0001…

bash shell sed file-rename
How do I escape double and single quotes in sed?

From what I can find, when you use single quotes everything inside is considered literal. I want that for my …

bash command-line sed
Turning multiple lines into one comma separated line

I have the following data in multiple lines: foo bar qux zuu sdf sdfasdf What I want to do is …

linux perl unix sed awk