Language Selection

English French German Italian Portuguese Spanish

Linux quicktip - find and replace from the command line using sed

Filed under
HowTos

If you’ve ever had to modify files on your Linux system and simply change a word or two, there’s a fast and simple way to do this using sed.

Say you want to change your sources.list file to go from Ubuntu 6.06 (Dapper) to 6.10 (Edgy). You can do this with a one line command using sed.

sudo sed -i ’s/dapper/edgy/g’ /etc/apt/sources.list

You’ve just replaced all of your instances of the word ‘dapper‘ with ‘edgy‘.

You can also combine the sed command with the find command for a pretty powerful find and replace.

Full Story.

More in Tux Machines

Another Surprise: Mageia 5 RC is available!

I don't know why DistroWatch seemed to have missed it, but Mageia 5 RC is available for download. Read more

Another Surprise: Mageia 5 RC is available!

I don't know why DistroWatch seemed to have missed it, but Mageia 5 RC is available for download. Read more

The Open Source Community Support System

Whether you’re a novice Web developer or seasoned CIO, at some point you will require technical support with either a new IT development, task or project. What type of support will you want? With open source software, the flexibility and choice is yours. Read more

Debian 8.0 Jessie has been released!

There's a new sheriff in town. And her name is Jessie. We're happy to announce the release of Debian 8.0, codenamed Jessie. Want to install it? Choose your favourite installation media among Blu-ray Discs, DVDs, CDs and USB sticks. Then read the installation manual. For cloud users Debian also offers pre-built OpenStack images ready to use. Already a happy Debian user and you only want to upgrade? You are just an apt-get dist-upgrade away from Jessie! Find how, reading the installation guide and the release notes. Do you want to celebrate the release? Share the banner from this blog in your blog or your website! Read more