一些自己总结的linux指令_20171205

ps -ef|grep XL    --显示所有XL相关的进程
ps -ef |grep xl |wc -l    —显示所有XL相关进程的数量

ps -ef|grep xl.py|grep -v grep|awk '{print $2}'|xargs kill -9    -- awk '{print $2}’以空格分离,取第二个字符; “grep -v grep" 在文档中过滤掉包含有grep字符的行; 

  • 杀掉所有XL开头的进程。
ps -ef|grep XL |grep -v grep | awk '{print $2}'| xargs kill -9
tar -zxvf /home/ceshi/MJHaiNan_16286_20170531105021.tar.gz    -- 解压一个打包文件
netstat -nat|grep -i "8001"|wc -l    —统计8001(忽略大小写)所有有效的链接数量
netstat -nat|grep 'ip.800'|wc -l
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}' 
  • 拷贝数据
scp -r -P 9800 ceshi@ip:/opt/CardServer/shianxi .
scp -r -P 9800 test@ip:/opt/CardServer/TeamServer/team.py .
scp -r -P 9800 /Users/macuser/qd/XLMatchServer ceshi@ip:/home/ceshi/qudi/ 
  • 调整服务器时间
date -s '2017-11-24 10:00' 
  • 安装except
yum install except 
  • python脚本
nohup python -u xl.py > out.log 2>&1 &
杀掉python脚本
ps -ef|grep python |grep -v grep | awk '{print $2}'| xargs kill -9
查看out.log
tail -f out.log
nohup python -u xl.py 1000 > out.log 2>&1 & 
  • 查看gate数量
netstat -nat|grep 'ip'|wc -l
netstat -nat|grep 'ip.800'|wc -l 
  • 服务器时间与网络时间同步:ntpdate -u ntp.api.bz


ab -n 1000000 -c 10000 -p post.txt -T application/x-www-form-urlencoded -r   http://120.78.225.253/








评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值