masukomi
masukomi

Reputation: 10892

built in unix / linux command for recursive find and replace?

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?

Edit: The Digital Ninja points out that it's rpl.

However 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. OS X Users can download a binary at http://www.laffeycomputer.com/rpl.html

Upvotes: 1

Views: 2927

Answers (2)

Geo
Geo

Reputation: 96837

I think some variation of the following would work :

find . -name *.extension | perl -pi.bak -e "s/text_to_be_replaced/replacement/"

Upvotes: 1

The Digital Ninja
The Digital Ninja

Reputation: 1120

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

Upvotes: 2

Related Questions