Basic Text Replacement Using sed Substitution
📖 Scenario: You have a text file that contains a list of fruits. You want to replace one fruit name with another using a simple command.
🎯 Goal: Learn how to use the sed command to substitute text in a file and display the changed content.
📋 What You'll Learn
Create a text file named
fruits.txt with specific fruit names.Define the fruit name to replace using a variable.
Use
sed substitution to replace the fruit name in the file content.Display the updated content on the screen.
💡 Why This Matters
🌍 Real World
Text substitution is common when updating configuration files, logs, or data files automatically without opening them manually.
💼 Career
Knowing how to use sed substitution helps in system administration, automation scripts, and data processing tasks.
Progress0 / 4 steps