Every editor will have an options to search and replace content of a file .When we require to search all files in a directory and replace with new string, we can use below command
perl -pi -e 's/<Search-string>/<Replace-String>/' *
For example If You want to replace windows with linux in all perl files under a directory, You can use this command
perl -pi -e 's/windows/linux/' *.pl
No comments:
Post a Comment