Posted in Command Line, Perl Command to Replace a String in all Files in Current Directory Binny V A March 12, 2007 Leave a Comment on Command to Replace a String in all Files in Current Directory Replaces all instance of ‘<old string>’ with ‘<new sting>’ in all the files of the current directory. perl -pi -e "s/<old string>/<new string>/g;" * [tags]perl,command,rename,replace,string[/tags] Author: Binny V AA philosopher programmer who specializes in backend development and stoicism.