查一个端口被哪个程序所使用
1. 使用netstat查看端口被那个进程使用,如下,4000被test_abc这个程序使用,进程ID是23426
[root@mam log]# netstat -ltnp | grep 4000 tcp 0 0 192.168.8.70:4000 0.0.0.0:* LISTEN 23426/test_abc
2. 使用ps命令看这个进程的详细信息
[root@mam log]# ps -ef | grep 23426root 22582 20511 0 11:35 pts/10 00:00:00 grep 23426 507 23426 1 0 2012 ? 02:20:03 test_abc -c /home/maming/test_abc.conf