当前位置:首页 » 操作系统 » linux查看接口

linux查看接口

发布时间: 2022-09-07 00:33:04

linux查看硬盘接口方法有哪些

在linux下经常需要查看当前的硬件配置,cpu内存在
cat
/proc/….里就能看到,硬盘的具体情况需要特殊的命令。
软件raid:
cat
/proc/mdstat
硬件raid:最好通过raid厂商提供的管理工具来查看。
不过可以通过查看物理插口来自己推测:
cat
/proc/scsi/scsi
Attached
devices:
Host:
scsi0
Channel:
00
Id:
00
Lun:
00
Vendor:
ServeRA
Model:
8k-l
Stripe
Rev:
V1.0
Type:
Direct-Access
ANSI
SCSI
revision:
02
Host:
scsi0
Channel:
01
Id:
00
Lun:
00
Vendor:
SEAGATE
Model:
ST3300655SS
Rev:
S527
Type:
Direct-Access
ANSI
SCSI
revision:
05
Host:
scsi0
Channel:
01
Id:
03
Lun:
00
Vendor:
SEAGATE
Model:
ST3300655SS
Rev:
S527
Type:
Direct-Access
ANSI
SCSI
revision:
05
Host:
scsi0
Channel:
01
Id:
05
Lun:
00
Vendor:
SEAGATE
Model:
ST3300655SS
Rev:
S527
Type:
Direct-Access
ANSI
SCSI
revision:
05
Host:
scsi0
Channel:
03
Id:
00
Lun:
00
Vendor:
IBM-ESXS
Model:
VSC7160
Rev:
1.07
Type:
Enclosure
ANSI
SCSI
revision:
03
根据这些信息,我们可以得知:
目前插入了3块硬盘型号一致的硬盘,根据硬盘串号ST3300655ss到网上查询,得知是希捷SAS300G的3.5寸,通过命令
df
-h
我们得知系统的总容量是810G,吻合300*3=900G

Ⅱ 如何用linux查看服务器器的端口

在Linux中查找服务的端口

方法1:使用grep命令

要使用grep命令在Linux中查找指定服务的默认端口号,只需运行:

$grep<port>/etc/services

例如,要查找SSH服务的默认端口,只需运行:

$grep ssh/etc/services

就这么简单。此命令应该适用于大多数Linux发行版。以下是我的Arch Linux测试机中的示例输出:

ssh 22/tcp

ssh 22/udp

ssh 22/sctp

sshell 614/tcp

sshell 614/udp

netconf-ssh 830/tcp

netconf-ssh 830/udp

sdo-ssh 3897/tcp

sdo-ssh 3897/udp

netconf-ch-ssh 4334/tcp

snmpssh 5161/tcp

snmpssh-trap 5162/tcp

tl1-ssh 6252/tcp

tl1-ssh 6252/udp

ssh-mgmt 17235/tcp

ssh-mgmt 17235/udp

正如你在上面的输出中所看到的,SSH服务的默认端口号是22。

让我们找到Apache Web服务器的端口号。为此,命令是:

$grep http/etc/services

#http://www.iana.org/assignments/port-numbers

http 80/tcp www www-http#WorldWideWeb HTTP

http 80/udp www www-http#HyperText Transfer Protocol

http 80/sctp#HyperText Transfer Protocol

https 443/tcp#http protocol over TLS/SSL

https 443/udp#http protocol over TLS/SSL

https 443/sctp#http protocol over TLS/SSL

gss-http 488/tcp

gss-http 488/udp

webcache 8080/tcp http-alt#WWW caching service

webcache 8080/udp http-alt#WWW caching service

[...]

ftp端口号是什么?这很简单!

$grep ftp/etc/services

ftp-data 20/tcp

ftp-data 20/udp

#21 is registered to ftp,but also used by fsp

ftp 21/tcp

ftp 21/udp fsp fspd

tftp 69/tcp

[...]

方法2:使用getent命令

如你所见,上面的命令显示指定搜索词“ssh”、“http”和“ftp”的所有端口名称和数字。这意味着,你将获得与给定搜索词匹配的所有端口名称的相当长的输出。

但是,你可以使用getent命令精确输出结果,如下所示:

$getent services ssh

ssh 22/tcp

$getent services http

http 80/tcp www www-http

$getent services ftp

ftp 21/tcp

如果你不知道端口名称,但是知道端口号,那么你只需将端口名称替换为数字:

$getent services 80

http 80/tcp

要显示所有端口名称和端口号,只需运行:

$getent services

Ⅲ 端口linux查看网口的命令

一、首先是最简单明了的两个命令, ifconfig和lspci。
ifconfig: 最常用的配置和查看网络接口信息的命令,服务器上执行此命令会得到类下文的内容。
二、lspci |grep -i 'eth' 或 lspci | grep -i net命令:可列出每个pci总线上的设备,通过grep过滤后可得到网卡设备列表

Ⅳ linux系统怎么查看端口

Linux系统一般可以使用netstat、lsof等命令来查看端口,用法示例:
netstat -tualp
netstat -tunlp|grep 8080(换成具体端口号)
lsof -i:8080(换成具体端口号)

Ⅳ Linux配置router查看接口信息

Router>enable 进入特权模式
Router#configure terminal 进入配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface e 0/0 进入接口以太0/0
Router(config-if)#ip
Router(config-if)#ip address 192.168.1.1 255.255.255.0 配置IP地址和子网掩码
Router(config-if)#no shutdown 开启端口
%LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
Router(config-if)#exit退出
Router(config)#ip host xiay 192.168.1.2默认域名指向(可以不配置的)
Router(config)#exit退出
Router#show interfaces e 0/0查看以太0/0信息
Ethernet0/0 is up, line protocol is up开启端口
Hardware is Lance, address is 000C.4198.5973 (bia 000C.4198.5973)MAC地址
Internet address is 192.168.1.1/24IP和掩码
MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec, rely 255/255, load 1/255
Encapsulation ARPA, loopback not set, keepalive set (10 sec)
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:00, output 00:00:00, output hang never
Last clearing of show interface counters never
Queueing strategy: fifo
Output queue 0/40, 0 drops; input queue 0/75, 0 drops
5 minute input rate 1000 bits/sec, 2 packets/sec
5 minute output rate 1000 bits/sec, 2 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 input packets with dribble condition detected
0 packets output, 0 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out

Router#ping 192.168.1.2pingIP地址

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms通了
Router#ping xiayping 域名(就是刚才定向的那个)

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms通了

Router# startup-config tftp 拷贝我的配置文件到tftp
Address or name of remote host []?xiay拷贝到这(也可以输入IP)
Destination filename []?1保存文件名
No NVRAM configuration present失败

Router#
Router#show startup-config 检查我的配置 没有
%% Non-volatile configuration memory is not present
Router# running-config startup-config 把我ram上的配置到nvram上去
Destination filename [startup-config]?
Building configuration...
[OK]

Router#sh startup-config 再查看下 OK东西有了
Current configuration : 677 bytes

!
Version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router
!
!
!
ip subnet-zero
ip host xiay 192.168.1.2
!
!
!
!
!
!
!
!
!

Router# startup-config tftp 拷贝 同上
Address or name of remote host []?xiay
Destination filename []?1
!!!!!!!!!!成功了!!!!!!!
[OK]
8390 bytes copied in 7 secs
===================================

boson 行敲出来顺便给你贴上去的 够详细了把 不加分对不起我啊

Ⅵ linux如何查看端口

x使用过程中,需要了解当前系统开放了哪些端口,并且要查看开放这些端口的具体进程和用户,可以通过netstat命令进行简单查询
netstat命令各个参数说明如下:
-t : 指明显示TCP端口
-u : 指明显示UDP端口
-l : 仅显示监听套接字(所谓套接字就是使应用程序能够读写与收发通讯协议(protocol)与资料的程序)
-p : 显示进程标识符和程序名称,每一个套接字/端口都属于一个程序。
-n : 不进行DNS轮询,显示IP(可以加速操作)
即可显示当前服务器上所有端口及进程服务,于grep结合可查看某个具体端口及服务情况··
netstat -ntlp //查看当前所有tcp端口·
netstat -ntulp |grep 80 //查看所有80端口使用情况·
netstat -ntulp | grep 3306 //查看所有3306端口使用情况·

Linux查看程序端口占用情况
使用命令:
ps -aux | grep tomcat
发现并没有8080端口的Tomcat进程。
使用命令:netstat –apn
查看所有的进程和端口使用情况。发现下面的进程列表,其中最后一栏是PID/Program name
发现8080端口被PID为9658的java进程占用。
进一步使用命令:ps -aux | grep java,或者直接:ps -aux | grep pid 查看
就可以明确知道8080端口是被哪个程序占用了!然后判断是否使用KILL命令干掉!
方法二:直接使用 netstat -anp | grep portno
即:netstat -anp|grep 8080

netstat -anp|grep 8080 --> tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 28500/java
ps -aux | grep 28500 --> r/local/tomcat9-jforum/tomcat

安装lsof list open files//---也可以 netstat -tunlp|grep 端口号 netstat -anp|grep 端口号
yum install lsof
lsof -i:8080 查看8080端口占用
lsof abc.txt 显示开启文件abc.txt的进程
lsof -c abc 显示abc进程现在打开的文件
lsof -c -p 1234 列出进程号为1234的进程所打开的文件
lsof -g gid 显示归属gid的进程情况
lsof +d /usr/local/ 显示目录下被进程开启的文件
lsof +D /usr/local/ 同上,但是会搜索目录下的目录,时间较长
lsof -d 4 显示使用fd为4的进程
lsof -i 用以显示符合条件的进程情况
lsof -i[46] [protocol][@hostname|hostaddr][:service|port]
46 --> IPv4 or IPv6
protocol --> TCP or UDP
hostname --> Internet host name
hostaddr --> IPv4地址
service --> /etc/service中的 service name (可以不止一个)
port --> 端口号 (可以不止一个)
lsof -i //显示所有打开的端口
lsof -i:80 //显示所有打开80端口的进程
lsof -i -U //显示所有打开的端口和UNIX domain文件

其实我一般这样用:

[root@VM_39_230_centos bin]# lsof -i:3306
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mysqld 16422 mysql 19u IPv6 148794 0t0 TCP *:mysql (LISTEN)
mysqld 16422 mysql 39u IPv6 643698 0t0 TCP localhost:mysql->localhost:36582 (ESTABLISHED)
mysqld 16422 mysql 45u IPv6 643699 0t0 TCP localhost:mysql->localhost:36584 (ESTABLISHED)
mysql

Ⅶ linux查看端口占用的方法

使用lsof命令:lsof-i:port_number|grep(LISTEN);-i是用来查找和网络相关的文件,:号是必须的,它是标志你查找的是一个端口。port_number就是你要查找的端口号,譬如你要查找是否有程序占用了oracle的监听端口1521,就可以使用lsof-i:1521|grep(LISTEN)。如果有程序已经占用了,那么下面打印的第二个字段就是该程序的进程id,第一个字段是进程的名字。
更多关于linux查看端口占用的方法,进入:https://www.abcgonglue.com/ask/cdf95e1615822305.html?zd查看更多内容

Ⅷ linux 怎样查看服务器网络接口属性,并将结果重定向到file9

查看的时候需要看一下接口高级设置当中具体的属性,完成属性高级定位,就可以将数据结果重新定位到文件当中。

Ⅸ linux查看运行的端口命令

一、使用 netstat 检查端口
netstat 是一个命令行工具,可以提供有关网络连接的信息。
要列出正在侦听的所有 TCP 或 UDP 端口,包括使用端口和套接字状态的服务,请使用以下命令:
netstat -tunlp
此命令中使用的选项具有以下含义:
-t - 显示 TCP 端口。
-u - 显示 UDP 端口。
-n - 显示数字地址而不是主机名。
-l - 仅显示侦听端口。
-p - 显示进程的 PID 和名称。仅当您以 root 或 sudo 用户身份运行命令时,才会显示此信息。
查询指定端口通过grep过滤:
netstat -tnlp | grep :80
二、使用 ss 检查端口
ss 是新的 netstat,命令选项大致相同。它缺少一些 netstat 功能,但暴露了更多的 TCP 状态,而且速度稍快。《Linux就该这么学》 一起学习linux
使用示例:ss -tunlp
三、使用 lsof 检查端口
lsof 是一个功能强大的命令行实用程序,它提供有关进程打开的文件的信息。
在 Linux 中,一切都是文件,可以将套接字视为写入网络的文件。
要使用 lsof 获取所有侦听 TCP 端口的列表:
lsof -nP -iTCP -sTCP:LISTEN
使用的选项如下:
-n - 不要将端口号转换为端口名称。
-p - 不要解析主机名,显示数字地址。
-iTCP -sTCP:LISTEN - 仅显示 TCP 协议状态为 LISTEN 的网络文件。
要查找正在侦听特定端口(例如 3306)的进程,请使用以下命令:
sudo lsof -nP -iTCP:3306 -sTCP:LISTEN

Ⅹ linux查看网线插在哪个接口

方法/步骤 1、进入linux,使用“ cat /etc/services ”命令,可以查看所有服务默认的端口列表信息。 2、使用“netstat”命令,查看正在连接的端口【连接】列表信息。 3、使用“nestat -a”命令,查看所有服务端口【监听、连接】列表信息。

热点内容
app什么情况下找不到服务器 发布:2025-05-12 15:46:25 浏览:708
php跳过if 发布:2025-05-12 15:34:29 浏览:461
不定时算法 发布:2025-05-12 15:30:16 浏览:125
c语言延时1ms程序 发布:2025-05-12 15:01:30 浏览:160
动物园灵长类动物配置什么植物 发布:2025-05-12 14:49:59 浏览:728
wifi密码设置什么好 发布:2025-05-12 14:49:17 浏览:143
三位数乘两位数速算法 发布:2025-05-12 13:05:48 浏览:390
暴风影音缓存在哪里 发布:2025-05-12 12:42:03 浏览:535
access数据库exe 发布:2025-05-12 12:39:04 浏览:623
五开的配置是什么 发布:2025-05-12 12:36:37 浏览:359