1.檢視tcp連線狀態
netstat -nat |awk ''|sort|uniq -c|sort -rn
netstat -n | awk '/^tcp/ ;end '
netstat -n | awk '/^tcp/ ; end '
netstat -n | awk '/^tcp/ ;end '
netstat -n |awk '/^tcp/ '|sort|uniq -c|sort -rn
netstat -ant | awk '' | grep -v '[a-z]' | sort | uniq -c
netstat -ant|awk '/ip:80/end' |sort -n
netstat -ant|awk '/:80/end' |sort -rn|head -n 10
awk 'beginend'
2.查詢請求數前20個ip(常用於查詢攻**):
netstat -anlp|grep 80|grep tcp|awk ''|awk -f: ''|sort|uniq -c|sort -nr|head -n20
netstat -ant |awk '/:80/end' |sort -rn|head -n20
3.用tcpdump嗅探80埠的訪問看看誰最高
tcpdump -i eth0 -tnn dst port 80 -c 1000 | awk -f"." '' | sort | uniq -c | sort -nr |head -20
4.查詢較多time_wait連線
netstat -n|grep time_wait|awk ''|sort|uniq -c|sort -rn|head -n20
5.找查較多的syn連線
netstat -an | grep syn | awk '' | awk -f: '' | sort | uniq -c | sort -nr | more
6.根據埠列程序
netstat -ntlp | grep 80 | awk '' | cut -d/ -f1
linux下用cronolog分割apache日誌
說明 淡綠色底的為linux命令,其他的為備註說明。wget 解壓縮 tar xzvf cronolog 1.6.2.tar.gz 進入目錄 cd cronolog 1.6.2 列出所有檔案 ll configure configure prefix usr local cronolog make ...
Linux下grep命令詳解
grep命令是linux下的行過濾工具,其引數繁多,下面就一一介紹個個引數的作用,希望對大家有所幫助。grep print lines matching a pattern 將符合樣式的該行列出 語法 grep options pattern file.grep用以在file內文中比對相對應的部分,...
Linux下grep命令詳解
原文 grep命令是linux下的行過濾工具,其引數繁多,下面就一一介紹個個引數的作用,希望對大家有所幫助。grep print lines matching a pattern 將符合樣式的該行列出 語法 grep options pattern file.grep用以在file內文中比對相對應的...