Sed Command to Delete Lines: Sed command can be used to delete or remove specific lines which matches a given pattern or in a particular position in a file. Here we will see how to delete lines using sed command with various examples.
2篇 sed related articles
github上的原文:sed command with -i option failing on Mac, but works on Linux
不是最佳方案,但比较好,-i''可以直接覆盖,不用创建备份。
This works with both GNU and BSD versions of sed:
sed -i'' -e 's/old_link/new_link/g' *
or with backup:
sed -i'.bak' -e 's/old_link/new_link/g' *