linux查看本机ip和端口号的命令是什么?


本文摘自PHP中文网,作者烟雨青岚,侵删。

linux查看本机ip的命令是“ifconfig”命令和“ip address”命令;linux查看端口号的命令是“lsof -i:port”命令和“netstat -aptn”命令。

查看本机ip:

1)ifconfig命令

输出如下:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

[root@topgun /home/cly]

# ifconfig

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 192.168.128.132  netmask 255.255.255.0  broadcast 192.168.128.255

        inet6 fe80::20c:29ff:fe45:63ba  prefixlen 64  scopeid 0x20<link>

        ether 00:0c:29:45:63:ba  txqueuelen 1000  (Ethernet)

        RX packets 1936  bytes 2440516 (2.3 MiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 1207  bytes 94802 (92.5 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

        device interrupt 19  base 0x2024 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436

        inet 127.0.0.1  netmask 255.0.0.0

        inet6 ::1  prefixlen 128  scopeid 0x10<host>

        loop  txqueuelen 0  (Local Loopback)

        RX packets 12  bytes 744 (744.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 12  bytes 744 (744.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

该命令属于包:

1

2

3

[root@topgun /home/cly]

# pacman -Qo ifconfig

/sbin/ifconfig 属于 net-tools 1.60.20120804git-2

2)ip address命令

阅读剩余部分

相关阅读 >>

Linux查看日志的三种命令是什么

Linux系统怎么生成随机数

如何在Linux中查找文件创建时间(crtime)

如何ecs管理控制台版本信息区域删除模板和版本

制作了自定义镜像后怎么将镜像共享给其他阿里云用户使用

Linux中关于ftp、nfs、ssh服务器搭建的详细介绍

使用createnetworkinterface创建一个弹性网卡

Linux实现覆盖不提示

Linux服务器搭建svn环境方法详解

Linux 挂载 fat32 和 ntfs格式u盘实例教程

更多相关阅读请进入《Linux》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...