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

Leftovers: Software

today's howtos

Canonical Makes It a Lot Easier for Newcomers to Discover the Ubuntu Flavours

Canonical's Michael Hall had the great pleasure of announcing that the ubuntu.com website has been redesigned to make it easier for Ubuntu newcomers to discover the flavours of the world's most popular free operating system. Read more

Leftovers: Gaming