$
Linux Practice
Practice
Tutorials
English
한국어
日本語
中文
terminal
Welcome to Linux Practice Terminal!
Type "help" to see available commands.
user
@linux:
~
$
sed - Stream Editor
Reset Lesson
Learn to find and replace text, delete lines, and transform files using sed.
Step 1
Use sed to substitute "world" with "Linux" in a simple string.
Type: echo 'hello world' | sed 's/world/Linux/'
echo 'hello world' | sed 's/world/Linux/'
Step 2
Replace all occurrences of "Widget" with "SuperWidget" in sales.csv using the g flag.
Step 3
Delete empty lines from log.txt using a regex address with the d command.
Step 4
Pipe log.txt through sed to replace "ERROR" with "WARNING".
Step 5
Delete lines 1 through 3 from todo.txt using a line range address.