开发者

Bash dirs, files & files content renaming

开发者 https://www.devze.com 2023-03-25 05:50 出处:网络
I am trying to change a very simple w开发者_Python百科ord (\"discussion\") by another (\"item\") in a PHP script with files and a lot of subfolders.

I am trying to change a very simple w开发者_Python百科ord ("discussion") by another ("item") in a PHP script with files and a lot of subfolders.

I would like to change this word: 1- in all the files content 2- in the files names 3- in the directories names

A simple loop and some regexp could take care of 2 & 3, but how could I do 1 with bash?


use sed.

sed -i 's/discussion/item/g' <filename>
0

精彩评论

暂无评论...
验证码 换一张
取 消