Top "Sed" questions

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

sed with literal string--not input file

This should be easy: I want to run sed against a literal string, not an input file. If you wonder …

linux unix sed
Remove non-ASCII characters from CSV

I want to remove all the non-ASCII characters from a file in place. I found one solution with tr, but …

sed awk
In-place edits with sed on OS X

I'd like edit a file with sed on OS X. I'm using the following command: sed 's/oldword/newword/' …

macos file-io sed in-place
removing new line character from incoming stream using sed

I am new to shell scripting and i am trying to remove new line character from each line using SED. …

shell sed csh
Using SED with wildcard

I want to replace a string with wildcard but it doesn't work. The string looks like "some-string-8" I wrote sed …

bash sed wildcard
How to remove all special characters in Linux text

How to remove the special characters shown as blue color in the picture 1 like: ^M, ^A, ^@, ^[. In my understanding, ^M …

linux sed non-printable
How to use awk to print lines where a field matches a specific string?

I have: 1 LINUX param1 value1 2 LINUXparam2 value2 3 SOLARIS param3 value3 4 SOLARIS param4 value4 I need awk to print all lines …

sed awk
How to print the number of characters in each line of a text file

I would like to print the number of characters in each line of a text file using a unix command. …

shell unix sed awk
Appending a line to a file only if it does not already exist

I need to add the following line to the end of a config file: include "/configs/projectname.conf" to a …

linux sed terminal
bash, extract string before a colon

If I have a file with rows like this /some/random/file.csv:some string /some/random/file2.csv:some …

regex string bash sed substring