Skip to content
GoLinuxHub
  • Home
  • Linux Basics
  • Security
  • VMware
  • DevOps
  • Programming
  • Contact Me

Programming

sed: remove all leading and ending blank whitespace from a file

Here our requirement is to remove all the whitespace from the leading and ending space per line of a file. Our sample file /tmp/file    This is line one   This is line two  

1 Comment

sed: Insert multiple lines before or after pattern match

In my last articles I had shown you the arguments to be used with sed to add or append any character in the beginning or end of the line and to ignore whitespace while grepping

1 Comment

sed: Replace string based on line number (certain line)

Here our requirement is that we have a file where we have to perform a string replacement but based on line number. Below is our sample data /tmp/file 1 This is line one 2 This

Leave a comment

sed :Replace whole line when match found

Here our requirement is to replace a line with our content when a match is found with in the file Our sample file /tmp/file This is line one This is line two This is line

Leave a comment

sed: match string and append new line (before or after)

Before is the requirement for this example. I have a sample file with below content at /tmp/file This is line one This is line two This is line three This is line four Here in

Leave a comment

sed: Insert character in the beginning or end of line with matched pattern

In my last articles I had shared the arguments with sed which can be used to perform case insensitive actions (search, replace..) in a file and to delete all blank lines from the file. Before starting with some command

1 Comment

sed: insert word or text after match in middle of the line (search and append a string before or after match)

How to append a string after a match? For eg I have a text line "This is not test" where I would like to insert "really" after matching "is" Command: echo "This is not test"

1 Comment

How to run any script or cron job in Linux for every second

There was this one time when I ran into the situation when my /tmp partition was getting full at 100% and I got an threshold alert but again when I checked the same it was

3 Comments
Post navigation
Older posts
Newer posts
← Previous Page1 Page2 Page3 Next →

Recent Posts

  • 6 Best Practices For A Successful Cloud Backup
  • 5 reasons to try sports betting
  • How To Keep Your Business Data Secure In The Cloud 
  • 9 Tips For Safe And Secure Browsing
  • Some of the Most Helpful Tools Every Business Needs
  • How Long Does it Take to Create an Efficient Application?
  • Smart Home Devices Every Individual Must Have
  • What is a VPN and Why You May Need One
  • Mobile Casinos: Then and Now
  • The best screen recorders in 2021. What will be popular in 2022?
Copyright © 2023 | Hosted On Rocket.net