我知道进程名是tnskkk,我知道用ps ax|grep tnskkk 可以看到进程编号,并且可以敲命令kill 进程编号 杀掉这个进程!
但是在shell中如何实现了?
if ps ax|grep tnskkk
then
kill ?
fi
如何取进程id并杀之!
id="google_ads_iframe_/8456/IDG.CN_B2B_csdn.net_0" name="google_ads_iframe_/8456/IDG.CN_B2B_csdn.net_0" width="728" height="90" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" style="box-sizing: content-box; border-width: 0px; border-style: initial; vertical-align: bottom;">
-
id="iframeu1636200_0" src="http://pos.baidu.com/acom?rdid=1636200&dc=2&di=u1636200&dri=0&dis=0&dai=2&ps=822x948&dcb=BAIDU_UNION_define&dtm=BAIDU_DUP_SETJSONADSLOT&dvi=0.0&dci=-1&dpt=none&tsr=0&tpr=1455852037077&ti=%E5%A6%82%E4%BD%95%E7%94%A8b%20shell%E5%91%BD%E4%BB%A4%E5%8F%96%E5%87%BA%E6%9F%90%E4%B8%AA%E7%A8%8B%E5%BA%8F%E7%9A%84%E8%BF%9B%E7%A8%8Bid%E5%B9%B6%E6%9D%80%E4%B9%8B%EF%BC%81-CSDN%E8%AE%BA%E5%9D%9B-CSDN.NET-%E4%B8%AD%E5%9B%BD%E6%9C%80%E5%A4%A7%E7%9A%84IT%E6%8A%80%E6%9C%AF%E7%A4%BE%E5%8C%BA&ari=1&dbv=2&drs=1&pcs=1757x806&pss=1757x852&cfv=17&cpl=6&chi=1&cce=true&cec=UTF-8&tlm=1455852037<u=http%3A%2F%2Fbbs.csdn.net%2Ftopics%2F210083388<r=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DkUBpMj8YxjyXPgZZLBmJPinzg9z1rtUowqJNUOZsqxtMj1HKIYyLMLCy3bvIiDlI%26wd%3D%26eqid%3Ded72af240028867d0000000356c68636&ecd=1&psr=1920x1080&par=1920x1019&pis=-1x-1&ccd=24&cja=true&cmi=8&col=en-US&cdo=-1&tcn=1455852037&qn=1ee7629ca83411d0&tt=1455852037032.348.525.527" width="200" height="22" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" allowtransparency="true" style="box-sizing: content-box; border-width: 0px; border-style: initial; vertical-align: bottom; margin: 0px;">
-
id="iframeu1636201_0" src="http://pos.baidu.com/acom?rdid=1636201&dc=2&di=u1636201&dri=0&dis=0&dai=3&ps=934x1070&dcb=BAIDU_UNION_define&dtm=BAIDU_DUP_SETJSONADSLOT&dvi=0.0&dci=-1&dpt=none&tsr=0&tpr=1455852037077&ti=%E5%A6%82%E4%BD%95%E7%94%A8b%20shell%E5%91%BD%E4%BB%A4%E5%8F%96%E5%87%BA%E6%9F%90%E4%B8%AA%E7%A8%8B%E5%BA%8F%E7%9A%84%E8%BF%9B%E7%A8%8Bid%E5%B9%B6%E6%9D%80%E4%B9%8B%EF%BC%81-CSDN%E8%AE%BA%E5%9D%9B-CSDN.NET-%E4%B8%AD%E5%9B%BD%E6%9C%80%E5%A4%A7%E7%9A%84IT%E6%8A%80%E6%9C%AF%E7%A4%BE%E5%8C%BA&ari=1&dbv=2&drs=1&pcs=1757x806&pss=1757x971&cfv=17&cpl=6&chi=1&cce=true&cec=UTF-8&tlm=1455852037<u=http%3A%2F%2Fbbs.csdn.net%2Ftopics%2F210083388<r=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DkUBpMj8YxjyXPgZZLBmJPinzg9z1rtUowqJNUOZsqxtMj1HKIYyLMLCy3bvIiDlI%26wd%3D%26eqid%3Ded72af240028867d0000000356c68636&ecd=1&psr=1920x1080&par=1920x1019&pis=-1x-1&ccd=24&cja=true&cmi=8&col=en-US&cdo=-1&tcn=1455852038&qn=1dff2219472e6cf3&tt=1455852037032.570.644.645" width="200" height="22" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" allowtransparency="true" style="box-sizing: content-box; border-width: 0px; border-style: initial; vertical-align: bottom; margin: 0px;">
-
id="iframeu1636204_0" src="http://pos.baidu.com/acom?rdid=1636204&dc=2&di=u1636204&dri=0&dis=0&dai=4&ps=934x1192&dcb=BAIDU_UNION_define&dtm=BAIDU_DUP_SETJSONADSLOT&dvi=0.0&dci=-1&dpt=none&tsr=0&tpr=1455852037077&ti=%E5%A6%82%E4%BD%95%E7%94%A8b%20shell%E5%91%BD%E4%BB%A4%E5%8F%96%E5%87%BA%E6%9F%90%E4%B8%AA%E7%A8%8B%E5%BA%8F%E7%9A%84%E8%BF%9B%E7%A8%8Bid%E5%B9%B6%E6%9D%80%E4%B9%8B%EF%BC%81-CSDN%E8%AE%BA%E5%9D%9B-CSDN.NET-%E4%B8%AD%E5%9B%BD%E6%9C%80%E5%A4%A7%E7%9A%84IT%E6%8A%80%E6%9C%AF%E7%A4%BE%E5%8C%BA&ari=1&dbv=2&drs=1&pcs=1757x806&pss=1757x971&cfv=17&cpl=6&chi=1&cce=true&cec=UTF-8&tlm=1455852037<u=http%3A%2F%2Fbbs.csdn.net%2Ftopics%2F210083388<r=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DkUBpMj8YxjyXPgZZLBmJPinzg9z1rtUowqJNUOZsqxtMj1HKIYyLMLCy3bvIiDlI%26wd%3D%26eqid%3Ded72af240028867d0000000356c68636&ecd=1&psr=1920x1080&par=1920x1019&pis=-1x-1&ccd=24&cja=true&cmi=8&col=en-US&cdo=-1&tcn=1455852038&qn=b95a7069697aff45&tt=1455852037032.779.801.802" width="200" height="22" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" allowtransparency="true" style="box-sizing: content-box; border-width: 0px; border-style: initial; vertical-align: bottom; margin: 0px;">