Re: find and replace text in files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2003-03-28 at 15:15, ghwbush wrote:
> I have a directory of about 60 files.  I want to search these files and 
> replace some text.  Is there an easy way to do this from a command 
> line?

for file in `ls` ; do cat $file | sed 's/search/replace/' > $file.new ;
done

assuming you are searching for "search" and want to replace it with
"replace"

Piero



-- 
Psyche-list mailing list
Psyche-list@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/psyche-list

[Index of Archives]     [Fedora General Discussion]     [Red Hat General Discussion]     [Centos]     [Kernel]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux