Top "Sed" questions

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

sed not giving me correct substitute operation for newline with Mac - differences between GNU sed and BSD / OSX sed

I'm using this reference : sed help: matching and replacing a literal "\n" (not the newline) and I have a file "…

macos sed gnu bsd
"Event not found" error for shell command in unix

when i am trying to remove consecutive duplicate lines with awk "!x[$0]++" file its reporting x[: Event not found. even …

shell unix sed awk tcsh
Trying to remove non-printable characters (junk values) from a UNIX file

I am trying to remove non-printable character (for e.g. ^@) from records in my file. Since the volume to records …

bash unix awk sed non-printing-characters
Preserve line endings

I run sed to do some substitution on windows and I noticed that it automatically converts line endings to Unix (\…

windows sed
Execute a cat command within a sed command in Linux

I have a file.txt that has some content. I want to search for a string in file1.txt, if …

linux sed cat
How do i replace [] brackets using SED

I have a string that i am want to remove punctuation from. I started with sed 's/[[:punct:]]/ /g' But …

shell replace sed ksh brackets
SED without backup file

I use the following sed command to replace text in the file: sed -i -e 's/noreply@\(.*\).example.com/noreply@…

macos bash sed osx-mavericks
escaping newlines in sed replacement string

Here are my attempts to replace a b character with a newline using sed while running bash $> echo 'abc' | …

bash unix sed escaping solaris
Remove empty lines from txtfiles, remove spaces from start and end of line

Which one would be better: sed -e '/^$/d' *.txt sed 'g/^$/d' -i *.txt Also, how do I remove …

bash sed text-files spaces replace
Converting FASTQ to FASTA with SED/AWK

I have a data in that always comes in block of four in the following format (called FASTQ): @SRR018006.2016 GA2:6:1:20:650 …

shell awk sed fasta fastq