Text ProcessingLesson 19Free preview
Bash Stream Editor (sed)
This lesson is part of Bash · All levels
Summary
The sed command modifies the flow of text line by line, generally to search for and replace text. Substitution orders are in the form of old text and can be limited to a certain line. With the -i option, the changes are written directly to the file, so you'd better back it up first.
Key points
- Sed 's/long/new/' file changes patterns per line
- I save the changes directly to the file.
- n added p option p to display the selected line
- Addresses like 1.3 or / say / restrict the work area
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.