Language Selection

English French German Italian Portuguese Spanish

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

Filed under

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

Learning The Linux File System

Before we get started, let’s avoid any confusion. There are two meanings to the term “File System” in the wonderful world of computing: First, there is the system of files and the directory structure that all of your data is stored in. Second, is the format scheme that is used to write data on mass storage devices like hard drives and SSD’s. We are going to be talking about the first kind of file system here because the average user will interact with his or her file system every time they use a computer, the format that data is written in on their storage devices is usually of little concern to them. The many different file systems that can be used on storage is really only interesting to hardware geeks and is best saved for another discussion. Now that that’s cleared up, we can press on. (Read the rest at Freedom Penguin)

today's howtos

Red Hat and Fedora

FreeNAS 10 Enters Alpha, Brings Lots of New Technologies, Based on FreeBSD 10.2

FreeNAS' Jordan Hubbard was proud to announce the other day, October 8, the release and immediate availability for download of the first Alpha build of the upcoming FreeNAS open source Network Attached Storage (NAS) solution. Read more