实时查看正在执行的sql语句
1
|
/usr/sbin/tcpdump -i eth0 -s 0 -l -w - dst port 3306 | strings | egrep -i 'SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER|CALL'
|
查看http连接
1
|
netstat -n | awk '/^tcp/ {++state[$NF]} END {for(key in state) print key,"\t",state[key]}'
|
查看SYN状态的http连接
1
|
netstat -an | grep SYN | awk '{print $5}' | awk -F: '{print $1}' | sort | uniq -c | sort -nr | more
|
查看TIME_WAIT状态的http连接
1 2
|
netstat -tna | cut -b 49- |grep TIME_WAIT | sort |more
netstat -an | grep TIME_WAIT | awk '{print $5}' | awk -F: '{print $1}' | sort | uniq -c | sort -nr | more
|
查看ESTABLISHED状态的http连接
1 2
|
netstat -an | grep ESTABLISHED | awk '{print $5}' | awk -F: '{print $1}' | sort | uniq -c | sort -nr | more netstat -an | grep ":80" | grep ESTABLISHED | sort | more
|
批量kill进程
1
|
ps -efww|grep sqlr-listener|grep -v grep|cut -c 9-15|xargs kill -9
|
查看活动的php-cgi连接数
1
|
netstat -anpo|grep php-cgi|wc -l
|
按ip查看httpd连接数
1
|
netstat -anlp | grep 80 | grep tcp | awk {'print $5'} | awk -F: {'print $1'}| sort |uniq -c | sort -nr
|
禁IP
1
2
3
4
|
iptables -A INPUT -s IP地址 -j REJECT iptables -A INPUT -s IP地址/24 -j REJECT
route add -net IP地址 netmask 255.255.255.0 reject
|
调试命令
跟踪指定的进程pid.
跟踪指定的进程pid.
批量查找文件并删除
1 2
|
find . -name test.php -exec rm {} \; find . -name test.php | xargs rm -rf
|
更改某一目录下所有目录的权限, 不包括文件, aaa 是目录名
1
|
find aaa -type d -exec chmod 755 {} \;
|
替换文件内容
1
|
sed -i 's/b/strong/g' index.html
|
此命令搜索 index.html 文件中的 b 并将其替换为 strong。
http://www.lostk.com/blog/linux_webserver_cmd/
posted on 2008-12-19 09:47
Prog 阅读(353)
评论(0) 编辑 收藏 引用 网摘 所属分类:
Linux