Open in app
Donald Le
114 Followers
About

Sign in

114 Followers
About
Open in app

Replace text in file using sed in Linux

Donald Le

Donald Le

·Nov 17, 2020

When it comes to find text we often think of grep or awk. But to replace text in file is really simple with sed.

For example you want to replace “ensemble” to “ensembl”, just

sed -i 's/ensemble/ensembl/g' input.txt

Hope it helps

PEACE~~~

  • Linux
  • Command Line
  • Utilities
  • String
  • Replace

More from Donald Le

A passionate automation engineer who strongly believes in “A man can do anything he wants if he puts in the work”.

More From Medium

4 Reasons Why Now Is the Best Time to Start With Quantum Computing

Sara A. Metwalli in Better Programming

Jackson: More than JSON for Java

@cowtowncoder in Indeed Engineering

My Interview Experience With Microsoft

Ashwin Goel in Better Programming

How I migrate a Node.js App to Serverless using Lambda & API Gateway & Terraform

Herve Khg

Do I need python Scrapy to build a web scraper?

Riccardo Giorato in Better Programming

Align and Justify, what you need to know

Ahmad Chata

Provision & Configure Elastic Load Balancer to distribute traffic to backend AWS EC2 Instances

Daksh Jain

Deciphering Google’s Mysterious ‘batchexecute’ System

Ryan Kovatch

About

Help

Legal

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store