rename a string in multiple files
5 March, 2021 by
rename a string in multiple files
Administrator
| No comments yet


string Event

“Event” is capitol sensitive

grep –include={*.php,*.html,*.js,*.py,*.xml} -rnl ‘./’ -e “Event” | xargs -i@ sed -i ‘s/Event/Tour/g’ @

grep –include={*.php,*.html,*.js,*.py,*.xml,*.po,*.pot,*.rst} -rnl ‘./’ -e “Event” | xargs -i@ sed -i ‘s/Event/Tour/g’ @

grep –include={*.php,*.html,*.js,*.py,*.xml,*.po,*.pot,*.rst} -rnl ‘./’ -e “event” | xargs -i@ sed -i ‘s/event/tour/g’ @

 

http://stackoverflow.com/questions/11392478/how-to-replace-a-string-in-multiple-files-in-linux-command-line

 

Other bash information here :

http://mywiki.wooledge.org/BashFAQ/031

Some regex information :

http://www.regular-expressions.info/

On forums

http://askubuntu.com/questions/283145/pattern-based-batch-file-rename-in-terminal?rq=1

http://askubuntu.com/questions/153695/how-to-batch-rename-files-but-not-directories?rq=1

http://askubuntu.com/questions/699694/how-to-rename-files-in-multiple-folder-without-renaming-directories

http://askubuntu.com/questions/677044/rename-multiple-files-in-terminal

http://stackoverflow.com/questions/11392478/how-to-replace-a-string-in-multiple-files-in-linux-command-line

Sign in to leave a comment