Hello Everyone, in this post we will see how to insert a some text or special characters at the beginning or end of a multi-line file in Linux. Its really helpful when we have a file with more than 1000 lines or so.
Just open the terminal and open the file using vim editor.
Here we have a sample file having few email id’s per line,
Now Suppose we want to insert a special character for example ‘ at the beginning of each line, we can simply achieve it with a single command as shown below:
When we’ll run this command, it will insert ‘ at the beginning of each line.
Similarly to insert at the end of each line we can use below command:
This Command will insert ‘, at the end of each line as shown below:
Now Simply Save it & Enjoy 🙂