Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 04-05-2012, 08:48 AM   #1
Registered: Nov 2011
Posts: 106

Rep: Reputation: Disabled
how we can find and replace multiple file using sed command


I have text file in /etc/httpd/conf/httpd.conf ,How can i replace my Alias path using sed command

vi httpd.conf

Alias /Php /php/craftsynatx/php -

How can i change the line /php/craftsynatx/php to /php5/craft5/php

I used the following command ,but it does int works

:%s/php/craftsynatx/php/ /php5/craft5/php/g
Old 04-05-2012, 08:53 AM   #2
Registered: Nov 2011
Location: Germany, Bavaria, Nueremberg area
Distribution: openSUSE, Debian, LFS
Posts: 205

Rep: Reputation: 43
it is easier to use an other delimiter for s
s/// can also be written s%%% (whatever char comes first after the commans "s" will be the delimiter.

If you want to use "/" anyway, you have to escape each literaly meant "/" like "\/"


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] sed command to replace file extension leighya Linux - Newbie 18 04-22-2012 04:20 AM
[SOLVED] How to find and replace a text spanning multiple lines with sed haveanother Linux - Newbie 7 02-26-2012 07:29 AM
sed command to replace line in text file gengwei89 Linux - Newbie 6 11-06-2011 09:10 AM
Find and replace text in multiple file Bad_Bob Linux - Software 9 05-08-2008 03:31 AM
sed - find and replace command bullshit Programming 9 01-05-2006 04:25 AM

All times are GMT -5. The time now is 06:50 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration