1、查看Web服务器(Nginx Apache)的并发请求数及其TCP连接状态:
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
netstat -n|grep ^tcp|awk '{print $NF}'|sort -nr|uniq -c
或者:
netstat -n | awk '/^tcp/ {++state[$NF]} END {for(key in state) print key,"t",stat...
分类:
系统相关 时间:
2014-11-10 15:33:08
阅读次数:
227
要关闭一个服务,不管是windows还是 linux,原理都是一样,都是要关闭进程。1.查看进程ps - aux |grep svn2.关闭进程kill -9 id如果要启动的话,svn进程和普通的不太一样,即使重启,也要先执行先关闭,再启动svnserve -d -r /bak/ddj/svn/目...
分类:
系统相关 时间:
2014-11-10 15:21:59
阅读次数:
178
etstat -anp |grep 端口号root用户执行netstat -ntupln表示不查询dnst表示tcp协议u表示udp协议p表示查询占用的程序l表示查询正在监听的程序查看那个进程占用了xxx端口 lsof -i:xxx 查看进程号为xxx的进程在哪里 ps -ef|grep...
分类:
系统相关 时间:
2014-11-10 13:21:32
阅读次数:
208
linux字符串列截取 cut -d ‘分割条件’ -f ‘列数’[root@LocalWeb01 ~]# less /etc/passwd | grep '^user' | grep -v 'root' | cut -d ':' -f 1user1
分类:
系统相关 时间:
2014-11-10 08:39:47
阅读次数:
252
[root@LocalWeb01 log]# grep '^\[' acpidlinux中正则表达式和通配符的区别正则表达式是对文件内容,通配符是匹配文件名 例如 ls 'dddd*'
分类:
系统相关 时间:
2014-11-10 01:06:09
阅读次数:
330
使用 sed 只需要一个命令:sed -s -i 's/set_\([A-Za-z0-9_]*\)/\1 = /g' ` find . -name '*.cs' | xargs grep -l set_ `解释如下:` find . -name '*.cs' | xargs grep -l set_...
分类:
其他好文 时间:
2014-11-09 08:34:46
阅读次数:
141
今天jdk出现了一些环境问题,估计是open-jdk与后来安装的jdk版本冲突了,不得不卸载原有的open-jdk。 首先可以通过?dpkg -l | grep xxx?来查找某个应用程序的安装信息,通过?dpkg -r xxx?来卸载某个安装包。不...
分类:
系统相关 时间:
2014-11-08 10:35:23
阅读次数:
261
文件、目录搜索的小工具 用正则式限制文件名、关键字、目录 开始是专门为了搜索GBK和UTF8两种编码的文件,现在可以制定多种编码方式来搜索文件 本科生,代码可能很不规范 因为windows下好像没有grep,win7默认的搜...
分类:
其他好文 时间:
2014-11-07 19:25:09
阅读次数:
172
查找特定字符串并颜色显示
[root@fwq test]# grep -n 'the' regular_express.txt --color=auto
8:I can't finish the test.
12:the symbol '*' is represented as start.
15:You are the best is mean you are the no. 1.
16:The world is the same with "glad".
18:google is the...
分类:
系统相关 时间:
2014-11-07 17:08:59
阅读次数:
251