Intermediate Linux & Shell Scripting
Q46 / 100

What is the difference between "sed" and "awk", and what is each typically used for?

Correct! Well done.

Incorrect.

The correct answer is A) "sed" is a stream editor for simple line-based text transformations like substitutions, while "awk" is a fuller pattern-scanning language suited for extracting and manipulating fields from structured text such as columns

A

Correct Answer

"sed" is a stream editor for simple line-based text transformations like substitutions, while "awk" is a fuller pattern-scanning language suited for extracting and manipulating fields from structured text such as columns

Explanation

"sed" excels at line-based find/replace operations (e.g. "sed 's/foo/bar/g' file"), while "awk" provides a full scripting language for field-based processing, calculations, and formatted reporting (e.g. "awk '{print $1}' file").

Progress
46/100