linux command

原创
2018/06/14 10:38
阅读数 28

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 

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部