Thursday, August 20, 2009
Shell Scripting #0011 - Search and Replace in a File - SED Command
----------------------------Search and Replace in a File
----------------------------
sed -e "/a_word_in_a_line/s/pattern_to_search/replace_string/g" x
a_word_in_a_line --> any word to be searched in a line
s --> means to search
pattern_to_search --> pattern to be searched for
replace_string --> replacing string for the pattern found
g --> globally
Featured Blog Topics:
- MySQLDUMP: Taking Backup of Multiple Databases - http://kathyravan.blogspot.com/2009/02/mysqldump-taking-backup-of-multiple.html
- MD5 Hacker, Encryptor, Decryptor Online - http://kathyravan.blogspot.com/2009/02/online-md5-cracker-md5-decryptor-md5.html
- MySQL LEFT JOIN - http://kathyravan.blogspot.com/2009/01/mysql-left-join.html
- MySQL SQL_CACHE - http://kathyravan.blogspot.com/2008/12/mysql-sqlcache.html
- MySQL Query Caching - http://kathyravan.blogspot.com/2008/12/mysql-query-cache.html
- MySQL Show - http://kathyravan.blogspot.com/2008/12/mysql-show-statements.html
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment