方法:
sed -i "/ztj/iwhere" ztj.txt
root@logstash ~]# cat ztj.txt
linuxstudy
linux/home1 ztj1study
linux/home ztjstudy
linuxdastudy
linux/home2 ztj2study
linux/home3 ztj3study
linux/home4 ztj4study
[root@logstash ~]# sed -i "/ztj/iwhere" ztj.txt
[root@logstash ~]# cat ztj.txt
linuxstudy
where
linux/home1 ztj1study
where
linux/home ztjstudy
linuxdastudy
where
linux/home2 ztj2study
where
linux/home3 ztj3study
where
linux/home4 ztj4study
[root@logstash ~]#
标签:ztj,root,行前,linux,txt,where,logstash
From: https://blog.51cto.com/ztj1216/11969531