Linux Commands Helper
💬 Your AI-powered Linux assistant
sed Command - Stream Editor
The sed command is used to perform basic text transformations on an input stream or file.
Syntax
sed [options] 'command' [file...]
Examples
sed 's/old/new/g' file.txt
Replace all occurrences of "old" with "new" in file.txt.
echo \"hello world\" | sed 's/world/Linux/'
Replace "world" with "Linux" in the input text.
sed -n '2,4p' file.txt
Print lines 2 to 4 from file.txt.
Notes
- sed is powerful for text replacement, insertion, deletion, and more.
- Commands can be combined or provided in script files for complex operations.