views:

1340

answers:

2

Many people string together find and sed, or perl, or any number of other unix commands to find and replace across multiple files. But, there's a simple command that can do it for you without the hassle. Thanks to The Digital Ninja for pointing out that it's rpl.

This is not a built in command but, for debian based distros like Ubuntu you can simply install it with sudo apt-get install rpl

I would guess that it's available through most package managers in other *nix OSs.

+2  A: 

I belive you are thinking of 'rpl' http://www.linux.org/apps/AppId_2684.html

The Digital Ninja
+1  A: 

I think some variation of the following would work :

find . -name *.extension | perl -pi.bak -e "s/text_to_be_replaced/replacement/"
Geo
well, yes, and I alluded to that, but the point was to find a command that did it without the user having to string together various combinations of unix commands and perl, sed, or anything else.
masukomi
also, it would be perl -pi -e (no .bak)
masukomi
But you can always chain the commands yourself and put it on a simple shell script file.
Renato Soffiatto