运维平常集合(我的向 坚持更新)

运维平常集合(我的向)

平常运维经常使用集合,分三部分 windows、linux、Python
得益于python工具便利性,使得运维的工做大大减小。python

Shell

清除其余终端linux

who  //查看在线终端
pkill -9  -t pts/2

找出内存消耗的进程排序git

ps aux --sort=-rss | head -n 4

找出CPU消耗的进程排序github

ps aux --sort=-pcpu | head -4

持续 ping 并将结果记录到日志shell

ping api.jpush.cn  | awk '{ print $0"\t" strftime("%Y-%m-%d %H:%M:%S",systime()) } ' >> /tmp/jiguang.log &`

查看tcp链接状态windows

netstat -nat |awk '{print $6}'|sort|uniq -c|sort -rn

查找80端口请求数最高的前20个IPapi

netstat -anlp|grep 80|grep tcp|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -nr|head -n20`

Python

tldr

简化版本的man帮助页面,man帮助页面一般太长,因此做者取名tldr(too long don't read ),展现linux命令经常使用选项缓存

命令安装Github地址运维

tldr --update //本地缓存tcp

tldr commandname

字符密码

运维常常碰到建立新密码,本人本身作的随机字符串工具,数字、符号、字幕随机排序生成,支持保存到文本,若是以为好的话帮忙star下(readme 还没写好,写好了再更新)

CMD

批量获取局域网可用ip

for /L %D in (1,1,255) do ping 192.168.1.%D

for /l %D in (1,1,255) do (ping 192.168.1.%D -n 1 && echo 192.168.1.%D>>ok.txt || echo 192.168.1.%D >>no.txt)
相关文章
相关标签/搜索