當前位置:首頁 » 操作系統 » 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」命令,查看所有服務埠【監聽、連接】列表信息。

熱點內容
python練手項目 發布:2025-05-12 11:14:07 瀏覽:121
壓縮聽算音頻 發布:2025-05-12 10:58:12 瀏覽:800
資料庫系統報告 發布:2025-05-12 10:43:17 瀏覽:602
日產高配有哪些配置 發布:2025-05-12 10:32:16 瀏覽:475
大眾朗逸哪個配置值得入手 發布:2025-05-12 10:31:20 瀏覽:505
壓縮包的後綴 發布:2025-05-12 10:20:35 瀏覽:940
煙台招聘編程 發布:2025-05-12 10:04:21 瀏覽:53
sql查詢所有表名 發布:2025-05-12 10:01:28 瀏覽:665
用python編譯器的簡單代碼 發布:2025-05-12 09:48:40 瀏覽:358
香港多ip站群伺服器租用 發布:2025-05-12 09:33:16 瀏覽:896