Top "Sed" questions

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

How to remove leading whitespace from each line in a file

I have a file that looks something like this: for (i = 0; i < 100; i++) for (i = 0; i < 100; i++) for (…

unix sed awk grep
What are the differences among grep, awk & sed?

Possible Duplicate: What are the differences between Perl, Python, AWK and sed? What is the difference between sed and awk? …

linux bash sed awk grep
RE error: illegal byte sequence on Mac OS X

I'm trying to replace a string in a Makefile on Mac OS X for cross-compiling to iOS. The string has …

regex macos bash sed
Printing everything except the first field with awk

I have a file that looks like this: AE United Arab Emirates AG Antigua & Barbuda AN Netherlands Antilles AS …

perl awk sed
Using sed and grep/egrep to search and replace

I am using egrep -R followed by a regular expression containing about 10 unions, so like: .jpg | .png | .gif etc. This …

regex sed grep
Convert line endings

I have been using d2u to convert line endings. After installing Puppy Linux I noticed that it does not …

bash shell sed command-line dos2unix
Delete the first five characters on any line of a text file in Linux with sed

I need a one-liner to remove the first five characters on any line of a text file. How can I …

linux unix sed
how to remove the first two columns in a file using shell (awk, sed, whatever)

I have a file with many lines in each line there are many columns(fields) separated by blank " " the numbers …

perl shell awk sed cut
Insert multiple lines into a file after specified pattern using shell script

I want to insert multiple lines into a file using shell script. Let us consider my input file contents are: …

linux bash shell sed awk
Why does sed not replace all occurrences?

If I run this code in bash: echo dog dog dos | sed -r 's:dog:log:' it gives output: …

bash sed