LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-11-2013, 05:17 PM   #1
Fingers of Fudge
LQ Newbie
 
Registered: Aug 2007
Distribution: Slackware 13.0
Posts: 14

Rep: Reputation: 1
Replace all instances of a word in a group of files?


How would I replace all instances of a word in a group of files? I have Slackware installed and would like to know how from bash command line.

What I want to do is replace the word mislike with the word dislike in a group of .htm files

Thanks in advance :-)
 
Old 09-11-2013, 05:21 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Try sed

http://www.grymoire.com/Unix/Sed.html
 
1 members found this post helpful.
Old 09-11-2013, 05:29 PM   #3
Fingers of Fudge
LQ Newbie
 
Registered: Aug 2007
Distribution: Slackware 13.0
Posts: 14

Original Poster
Rep: Reputation: 1
ah okay....just had a flick through

will be something like:

Sed s/mislike/dislike *.htm

I will have a proper read and a play around :-)

E2A: thank you for the point in the right direction should be able to work it out from here I reckon :-)

Last edited by Fingers of Fudge; 09-11-2013 at 05:30 PM.
 
  


Reply



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] Find/Replace shell script that replaces word with other word in text, filenames yanom Programming 8 09-12-2012 12:29 AM
[SOLVED] Find and replace multiple instances gdavis2287 Programming 23 08-16-2010 12:40 PM
[SOLVED] how to search word in group of files using command sumeet inani Linux - Newbie 20 11-09-2009 07:46 AM
sed 1st word to replace all instances of ( donnied Programming 5 08-21-2008 06:43 PM
need sed help - how to replace all instances of X except those on lines with Y? BrianK Programming 4 03-25-2008 06:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:20 AM.

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