Linux:
cba001:~ # lsof -i:5300
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
named 26751 root 20u IPv4 64750499 TCP localhost:hacl-hb (LISTEN)
named 26751 root 21u IPv4 64750501 TCP cba001.eapac:hacl-hb (LISTEN)
named 26751 root 22u IPv4 64750503 TCP 192.168.0.10:hacl-hb (LISTEN)
named 26751 root 512u IPv4 64750498 UDP localhost:hacl-hb
named 26751 root 513u IPv4 64750500 UDP cba001.eapac:hacl-hb
named 26751 root 514u IPv4 64750502 UDP 192.168.0.10:hacl-hb
[注]:执行lsof -i:5300以后就可以看到26751进程在TCP和UDP上都打开了5300端口.
cba001:~ # ps -ef|grep 26751
root 10118 26915 0 12:59 pts/8 00:00:00 grep 26751
root 26751 1 0 Jul06 ? 00:02:06 /opt/ipworks/IPWdns/usr/bin/named
[注]:执行ps -ef|grep 26751以后就可以看到是named进程打开了5300端口
查看进程ID:
lsof -w -n -i tcp:8080
fuser -n tcp 8080netstat -anp|grep :8080[[:blank:]]
杀掉占用端口的进程PID:
kill -9 pidnumber
//过滤IP地址
iptables -A INPUT -m iprange --src-range 38.99.82.191-38.99.82.192 -j DROP
//查看系统是32位或64位
file /sbin/init
//查看系统屋里CPU个数
cat /proc/cpuinfo | grep "physical id" | sort | uniq |wc -l
//查看系统逻辑CPU个数
cat /proc/cpuinfo | grep "processor" | sort | uniq |wc -l
//查看系统内存使用情况
free -m
说明:total=used+free
实际使用内存=used-buffers-cached
实际可用内存=free+buffers+cached
swap内存与硬盘的交换区
//参看系统硬盘使用情况
df -Th
//查看系统某个目录的大小
du -sh /root
//查看网卡型号
lspci |grep Ether
//查看文件包含关键字的行数
grep -c "get from kmt" /data/ly/biz/log/biz_20140806.log
cba001:~ # lsof -i:5300
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
named 26751 root 20u IPv4 64750499 TCP localhost:hacl-hb (LISTEN)
named 26751 root 21u IPv4 64750501 TCP cba001.eapac:hacl-hb (LISTEN)
named 26751 root 22u IPv4 64750503 TCP 192.168.0.10:hacl-hb (LISTEN)
named 26751 root 512u IPv4 64750498 UDP localhost:hacl-hb
named 26751 root 513u IPv4 64750500 UDP cba001.eapac:hacl-hb
named 26751 root 514u IPv4 64750502 UDP 192.168.0.10:hacl-hb
[注]:执行lsof -i:5300以后就可以看到26751进程在TCP和UDP上都打开了5300端口.
cba001:~ # ps -ef|grep 26751
root 10118 26915 0 12:59 pts/8 00:00:00 grep 26751
root 26751 1 0 Jul06 ? 00:02:06 /opt/ipworks/IPWdns/usr/bin/named
[注]:执行ps -ef|grep 26751以后就可以看到是named进程打开了5300端口
查看进程ID:
lsof -w -n -i tcp:8080
fuser -n tcp 8080netstat -anp|grep :8080[[:blank:]]
杀掉占用端口的进程PID:
kill -9 pidnumber
//过滤IP地址
iptables -A INPUT -m iprange --src-range 38.99.82.191-38.99.82.192 -j DROP
//查看系统是32位或64位
file /sbin/init
//查看系统屋里CPU个数
cat /proc/cpuinfo | grep "physical id" | sort | uniq |wc -l
//查看系统逻辑CPU个数
cat /proc/cpuinfo | grep "processor" | sort | uniq |wc -l
//查看系统内存使用情况
free -m
说明:total=used+free
实际使用内存=used-buffers-cached
实际可用内存=free+buffers+cached
swap内存与硬盘的交换区
//参看系统硬盘使用情况
df -Th
//查看系统某个目录的大小
du -sh /root
//查看网卡型号
lspci |grep Ether
//查看文件包含关键字的行数
grep -c "get from kmt" /data/ly/biz/log/biz_20140806.log