sed
Syntax
sed [options] editor-fxn [input-file]
Example 1
Subsitute old value for new globally
sed 's/old/new/g' [file]
- s - subsitute
- old - old value
- new - new value
- g - all ocurrences on line not just the first one
Example 2
Delete the last character in each line
sed 's/.$//' filename
Example 3
Insert 3 spaces at the beginning of each line
sed 's/^/ /' filename
Example 4
Convert multiple spaces to single space
sed 's/ */ /g' filename
Example 5
Replace ei with ie
sed 's/ei/ie/g' filename