Linux常用命令-进阶版(以及端口的操作)

查看IP:  ip addr

如果使用 ifConfig 得先下载包(即下面这行命令)

sudo yum install net-tools

退出: wq:

Linux的默认端口:22

Windows 端口:3389

netstat -tln | grep 80 #查找指定被占用的端口

安装 lsof

yum install lsof

通过 lsof 可以知道我们端口属于哪个程序

lsof -i :80    #查询的端口
kill -9 #杀死进程id 多个进程ID使用空格隔开
原文地址:https://www.cnblogs.com/XiangZiPeng/p/10699186.html