杀掉含有test且不含有grep的进程,后面的 awk '{print $2}' 是进程号 ...
分类:
系统相关 时间:
2019-02-28 16:53:51
阅读次数:
156
#!/bin/bash#当文件大于1G时清空FILE=/root/hello.txt#判断文件是否存在if![-f$FILE]then#输出文件不存在echo"filenotexist!"exit1fiif[ls-l$FILE|awk‘{print$5}‘-gt$((1024*1024))]then#输出空到文件中echo"">$FIL
分类:
其他好文 时间:
2019-02-28 15:18:25
阅读次数:
192
参考:https://blog.csdn.net/weixin_42980713/article/details/86559017 ...
分类:
其他好文 时间:
2019-02-28 00:50:21
阅读次数:
153
状态统计 netstat -ant | awk '/tcp/ {print $6}'|sort |uniq -c |sort -nr 前十位ESTABLISHED状态ip统计 netstat -ant | grep "ESTABLISHED"|awk '/tcp/ {print $5}'|cut -... ...
分类:
Web程序 时间:
2019-02-27 23:32:44
阅读次数:
284
首先,要先配置好自己的Git,然后在某一处进行脚本的编写。 比如项目目录为:/home/project,那参考如下来进行 vim /home/project/automatic_git.sh 注意:过滤策略是查看当前带有 “*” 的分支,然后在当前分支处使用awk过滤分支名赋予branch变量,然后 ...
分类:
其他好文 时间:
2019-02-27 17:36:03
阅读次数:
182
#/bin/bash netstat -ant | grep "EST" | grep -v "22000" | awk '{print $5}' | grep -v "^10" | cut -d ":" -f1 | sort | uniq -c | sort -nr | awk '$1 > 4 {... ...
分类:
系统相关 时间:
2019-02-25 13:39:56
阅读次数:
213
[root@WX020 firewall]# cat /etc/sysconfig/iptables# Firewall configuration written by system-config-firewall# Manual customization of this file is not ...
分类:
其他好文 时间:
2019-02-25 13:19:54
阅读次数:
178
linux上文本处理上剑客:grep:文本过滤工具(模式:pattern)工具;grep:基本正则表达式,-E-Fegrep:扩展正则表达式,-G-Ffgrep:不支持正则表达式,sed:streameditor.流编辑器;文本编辑工具;awk:linux上的实现为gawk,文本报告生成器(格式化文本);正则表达式:由一类特殊字符及文本字符所编写的模式,其中有些字符不表示其字面意义,而是用于表示控
分类:
其他好文 时间:
2019-02-24 16:19:49
阅读次数:
253
面试题 使用Linux命令查询file1中空行所在的行号 [root@slave2 testshell]# awk '/^$/{print NR}' sed.txt 5 [root@slave2 testshell]# cat sed.txt dong shen guan zhen wo wo la ...
分类:
系统相关 时间:
2019-02-23 10:30:19
阅读次数:
226
一、了解机器连接数情况 问题:1.2.3.4的sshd的监听端口是22,如何统计1.2.3.4的sshd服务各种连接状态(TIME_WAIT/ CLOSE_WAIT/ ESTABLISHED)的连接数。 参考答案: netstat -n | grep 1.2.3.4:22 | awk '/^tcp/ ...
分类:
其他好文 时间:
2019-02-23 00:56:37
阅读次数:
249