$ cat test.txt 123 456 789 abc def $ cat test.txt | sed -e "/789/d" 123 456 abc def
$ cat test.txt 123 456 abc def $ cat test.txt | sed -e "/456/a 789" 123 456 789 abc def
$ cat test.txt 123ab 456ab abcab defab $ cat test.txt | sed -e "/456/i aaa" 123ab aaa 456ab abcab defab
$ cat test.txt 123 456 abc def $ cat test.txt | sed 's/456/789/g' 123 789 abc def
$ cat test.txt Defaults requiretty $ cat test.txt |sed 's/Defaults.*requiretty/#Default\trequiretty/g' #Default requiretty
sed -i '/disable/ s/yes/no/' /etc/xinetd.d/tftp"
If it is enclosed by \(target character string \), it is partially reused such as \1, \2, \3, … of the replaced character string
appendix