1.修改指定行
修改第三行
sed '3c\this is a changed line' test.txt
或
sed '/number 3/c\this is a changed line' test.txt
将二三行替换
sed '2,3c\this is a changed line' test.txt
1.修改指定行
修改第三行
sed '3c\this is a changed line' test.txt
或
sed '/number 3/c\this is a changed line' test.txt
将二三行替换
sed '2,3c\this is a changed line' test.txt