Take the 2-minute tour ×

Using sed, how can I remove lines with salaries ending 500?

Input file:

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Use this:

sed '/500$/d' filename

Or with grep:

grep -v 500$ filename

The $ denotes end of line. Also, the ^ character denotes the beginning of line. ^$ denotes a blank line.

share|improve this answer
Works great! Thank you jftuga for the explanations ... –  Steve Oct 8 '12 at 21:04

Your Answer


