Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在下面的脚本中用“+”替换所有出现的“用户名”,但它只替换第一次出现
ls -al | sed 's/username/+/'
这就是 sed 默认的工作方式?提前致谢。
您需要g(全局)修饰符:
g
sed 's/username/+/g'