Saturday, January 9, 2021

Linux Series - SED Utility/Package - 1. Installation

When you are working in Linux, you might have heard the term called 'SED' utility. Even if you don't, it is always good to know SED utility which makes your job easier when you are manipulating text.

'sed' stands for stream editor.  

  • It is a powerful text stream editor and can perform insertion, deletion, search and replace(substitution) on the input.
  • It supports regular expression which allows to perform complex pattern matching.

SED reads a line from the input stream (file, pipe, or stdin) and display the outcome in stdout. Also, it can update the output in the file as well when the option 'i' is passed along with sed command. We can cover this later in the series)

Lets stop theoretical definitions and go on for hands on to understand more about sed utility.

First job is to check sed package installed in your linux environment. To do so,

run the command "sed --version"

As you see, sed package is not installed in my environment, you need to install it.
To do so, run the command "sudo apt-get install -y sed" (Make sure you are running the command with super user access and you need to run "sudo yum install -y sed" if you are using centos linux distribution)


Now let us run the command (sed --version) to check sed package installed in my linux environment.


This is how you need to make sure the installation of sed package in your linux environment.

Hope you understand now 😀. 




No comments:

Post a Comment

Linux Series - SED Utility/Package - 4. Deleting Lines

Let’s explore sed’s explicit delete command, which you specify by using the option 'd'. Again, we are using the sample file named &#...