Click here to Skip to main content
15,886,085 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm using a Mac osx. I know that this code in the terminal will replace all txt files that include "hello" with "hiThere" in the folder named "world":

perl -pi -w -e 's/hello/hiThere/g;' ~/Desktop/world/*.txt


But inside that world folder there are other folders which have other txt files in them, and those don't go through the refactor or the rename, you have to then individually type the additional folders using the above method.

Is there a method that does it automatically for you?

What I have tried:

perl -pi -w -e 's/hello/hiThere/g;' ~/Desktop/world/*.txt
Posted
Updated 3-Apr-18 13:22pm
v2
Comments
Richard MacCutchan 28-Mar-18 8:31am    
Why have you tagged this question Java and not Perl?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900