0
2021.12.26
$ cat file
pool 0.ubuntu.pool.ntp.org iburst maxsources 1
$ sed -e 's/^\(.*pool\.ntp\.org\)/#\1/' file
#pool 0.ubuntu.pool.ntp.org iburst maxsources 1
説明:
^ # beginning of line
\( # start group 1
.* # 0 or more any character
pool\.ntp\.org # literally
\) # end group
置換:
# # character #
\1 # backreference to group 1