Quantcast
Channel: INDIA WEB HOSTING FAQs
Viewing all articles
Browse latest Browse all 15

Linux replace command all files with sed shell command

$
0
0

Replace word in all files with sed via linux shell command

To replace string design/nashik to designing/india on the same file textNashik.html
Use the following linux command with the syntax.
sed -i s:design/nashik:designing/india:g textNashik.html

Another Example:
sed -i s:twitter.com/webservices:twitter.com/dnswspl:g home/*.html

Replacing phrase in all files including directories and subdirectories using sed and find

find . -type f -exec sed -i ‘s:ecommerce.html:ecommerce-shopping-cart.html:g’ *.html {} \;

NOTE: ‘:’ used as a substitue for ‘/’ as / is used in search and replace.

Related: Linux Command, Shell Command, Sed Command, Replace Text, Linux Replace


Viewing all articles
Browse latest Browse all 15

Latest Images

Trending Articles





Latest Images