My Tweeter
ERROR_DESCRIPTION
ERROR_SERVER_RESPONSE 401
Technology
|
In Music
What's Hot
Tudlo is the easy way to find and review about events, places and establishment. Everybody knows that asking someone is the best way to find places and establishments. Tudlo collects and organize these recommendations in one convenient site -- and that is Tudlo.com.
Playing
Playing
- Tribal Wars
- Call of Duty 4
- NFS Most Wanted
- CNC Generals
- Kanes Wrath
Watching
Watching
- Smallville
- Heroes
- Terminator(Sarah Chronicles)
- Chuck
- Dexterk
Doing
Doing
- IP Telephony
- Open Source Technology
- Web Development
- Asterisk
| Find and Replace in Linux Command Line | | Print | |
| Written by Administrator |
| Wednesday, 28 January 2009 05:46 |
|
If doing find and replace words in Windows is as easy as opening the file in a text editor and clicking ctrl+F or F5 button, In Linux, you can easily do it through its command line using SED command.
For example we have a file which looks like this. #cat edzofcit.txt The filename is edzofcit.txt and we want to change Eddie into Joseph. To change Eddie into Joseph, you can write these command below. # sed -i -e "s/Eddie/Joseph/" edzofcit.txt
Since the command has "/" in it, you need specify an escape character "\\" before "/". Take a look below for example. # sed -i -e "s/Eddie/Joseph\\/Eddie/" edzofcit.txt We changed Eddie into Joseph/Eddie. #cat edzofcit.txt
That's all. With that code, you can now make a powerfule script that can replace files all at once.. See you at the next tutorial. :) |
| Last Updated ( Tuesday, 14 July 2009 06:09 ) |

