Use sed When
You want substitutions, deletions, or simple line-based transformations.
You are editing or filtering text streams with concise transformation rules.
How to choose between stream editing and field-oriented text processing.
sed is strongest when you are transforming streams with substitutions and line-oriented edits. awk becomes more useful when your logic depends on fields, conditions, and lightweight scripting.
You want substitutions, deletions, or simple line-based transformations.
You are editing or filtering text streams with concise transformation rules.
You need column or field-aware processing.
You want lightweight scripting with conditions, variables, and simple aggregation.
sed edits streams. awk reasons about fields.