prev next index

Using sed in Linux
Updated March 21, 2002
Created March 21, 2002

^ - Beginning of Line
$ - End of Line
. - Match any character including newline
* - Multiple

The quotes used for sed is a single quote, which is right next to the double quote.

Removing trailing content from a line.  In this case, we are removing from a colon ":" to the end of the line:
sed -e 's/:.*$//'

Removing spaces from the beginning of each line:

sed -e 's/^ *//'

Read the awk man page under the section "Regular Expressions" for more information.

prev next index
NEW! Search this Site!: