Linux查看端口占用与否
查看端口9010是否已占用
[dev_ydzj_1@localhost logs]$ lsof -i:9010
-bash: lsof: command not found
[dev_ydzj_1@localhost logs]$ whereis lsof
lsof: /usr/sbin/lsof /usr/share/man/man8/lsof.8.gz
[dev_ydzj_1@localhost logs]$ /usr/sbin/lsof -i:9010
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
java 18428 dev_ydzj_1 54u IPv6 405909367 TCP *:9010 (LISTEN)
[dev_ydzj_1@localhost logs]$
发现端口9010已被PID为18428线程占用