Q: How do I replace text in file using sed?
 

A: The below replaces text string "test" with the new string "test-new" in file called "text.txt".

# sed 's/test/test-new/g' text.txt

See also Replace text in file using perl.

Stop Spam Harvesters, Join Project Honey Pot

 

Get a free SSL certificate!

 

The leading nonprofit defending digital privacy, free speech, and innovation.

 

The Linux Foundation provides a neutral, trusted hub for developers and organizations to code, manage, and scale open technology projects and ecosystems.

 

Kubuntu is an operating system built by a worldwide community of developers, testers, supporters and translators.

 

 43ef5c89 CanonicalUbuntudarktext