系统相关
首页 > 系统相关> > linux command

linux command

作者:互联网

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

tail -n 1500 log.log | more 

tail -f -n 1500 log.log

ps -ef |grep processname |awk '{print $2}'|xargs kill -9
ps -ef |grep processname |grep -v grep | awk '{print $2}'| xargs echo
Explain :  ps -ef  --> ps list processes . -e show all processes , not just those belonging to the user . -f show processes in full format . 
           grep processname  --> find lines containing   processname . 
           grep -v grep --> filter out the grep process . 
           awk 'print $2' --> tokenize  a line by blank space  .  $2  take the second word .   reference : http://blog.51cto.com/loofeer/775267
           xargs --> construct the input param as a list . 
           kill -9  --> kill all the processes by input pid 

转载于:https://my.oschina.net/yixinnemo/blog/1830069

标签:ps,processes,grep,log,ef,processname,command,linux
来源: https://blog.csdn.net/weixin_33893473/article/details/92434367