Sed-Stream Editor

From Script | Spoken-Tutorial
Revision as of 18:00, 22 July 2021 by Nirmala Venkat (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Sed stands for Stream EDitor.

It is a very powerful utility offered by Linux/Unix systems. It is mainly used for text substitution, find and replace. It can also perform other text manipulations like insertion, deletion etc. Sed command supports regular expression which allows it to perform complex pattern matching which makes Sed an even more powerful test manipulation tool. With Sed, we can edit the files without actually opening it.

Sed operates on a stream of text that it reads from either a text file or from standard input (STDIN). We can send the output of another command directly into Sed for editing, or we can work on a file that we have already created. Sed outputs everything to standard out (STDOUT) by default. That means that, unless redirected, Sed will print its output to the screen instead of saving it in a file.

The Spoken Tutorial effort for Sed-Stream EDitor has been contributed by Nirmala Venkat from Spoken Tutorials team.

The domain review is done by Rohan Mhatre from the FOSSEE team.


Basic Level

  1. Overview of Sed
    • About Sed
    • Features of Sed
    • Who can use Sed?
    • About Sed Substitute command
    • About Sed special characters
    • About Sed commands with Files
    • About more on Sed commands
    • About Advanced Sed Command
    • About Spoken Tutorial workshops
    • Timed discussion forum of Spoken Tutorials
  2. Sed substitute command
    • Workflow of Sed command
    • Sed command with standard input
    • Example to show case sensitive of Sed command
    • Example to explain the workflow of Sed command
    • Sed command with 'G' option
    • About substitute command
    • Various options with substitute command
    • About global replacement
    • Regular expression in substitute command
    • Different flags in substitute command
  3. Sed special characters
    • About Print command
    • Various options in Print command
    • How to use special characters such as
      • $ (dollar)
      • ^ (caret)
      • = (equal to)
      • &(ampersand)
    • About tilde(~) operator
    • About plus(+) operator
    • Regular expression with . and *
    • Square bracket regular expression
    • Various options in regular expression
  4. Sed commands with Files
    • About Delete command
    • About Write command
    • About Read command
    • About Append command
    • About Insert command
    • About Change command
    • About Execute command
    • Demonstration of above commands with examples
    • Point to note in Delete command
    • Different options in the above commands
  5. More on Sed commands
    • About e (execute) command
    • Demonstration to execute a set of Linux commands using Sed
    • About -f flag
    • Demonstration to use multiple substitute commands inside a script file
    • About -e flag
    • Demonstration to combine multiple Sed commands in a single command
    • About transform flag y
    • Demonstration of y flag in Sed
    • How to use escape character in Sed substitute command?
    • How to use delimiter in Sed command?

Intermediate Level

  1. Advanced Sed Command
    • How Sed commands useful to Programmers and System Administrators?
    • Sed commands with C source code
    • Print only the function names in the C program
    • How to change the variable name in the C source code?
    • Sed commands with Python program files
    • Replace a string in the .py files in a folder
    • Sed commands with Bash shell scripts
    • Create a separate Apache config file for a list of websites
    • Bash script with for loop to fetch all the site names
    • Demonstration on the creation of config files for a list of websites

Contributors and Content Editors

Nirmala Venkat