sed instance

insert "xxx" before line 2 of b.txt
    sed '2 i/xxx' b.txt

insert "xxx" after line 2 of b.txt

    sed '2 a/xxx' b.txt

at b.txt Insert "xxx" after lines 2 and 3 of b.txt insert "xxx" before lines 2 and 3 of
    b.txt sed '2,3 a/xxx     ' ' b.txt inserts "xxx" before the 2nd to the last line of b.txt     sed '2,$ i/xxx' b.txt summarizes     the insert before the specified line using "i", and after the specified line Insertion is using "a"







Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326709441&siteId=291194637
sed