我想用sed -i替换所有文件。我想用newstring替换word oldstring
root-:
sed -i "s| oldstring | newstring |g" *
参数列表太长
我在同一个目录中有很多文件。我想替换所有文件字符串。
我怎么解决这个问题?
要在没有命令行太长的情况下生成所需数量的命令行,请使用find
:
find . -maxdepth 1 -type f -exec sed -i "s| oldstring | newstring |g" {} +