溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

如何查看linux和centos的基本配置

發(fā)布時(shí)間:2021-12-18 10:00:30 來源:億速云 閱讀:159 作者:iii 欄目:大數(shù)據(jù)

本篇內(nèi)容主要講解“如何查看linux和centos的基本配置”,感興趣的朋友不妨來看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來帶大家學(xué)習(xí)“如何查看linux和centos的基本配置”吧!

linux 版本和 centos 版本

# 查看 linux 版本
$ uname -a
Linux shanyue 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

# 查看 centos 版本號(hào)
$ cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
     

內(nèi)存配額及使用情況

查看還有多少內(nèi)存,available 指還有多少可用內(nèi)存

# -h 指打印可視化信息
$ free -h
              total        used        free      shared  buff/cache   available
Mem:           3.7G        154M        2.1G        512K        1.5G        3.3G
Swap:            0B          0B          0B
   

CPU 核心數(shù)量及使用率

# 查看 cpu 的核心數(shù)
$ cat /proc/cpuinfo

# 查看
$ top

$ htop
   

磁盤使用情況

$ df -h

平均負(fù)載

load average 指單位時(shí)間內(nèi)運(yùn)行態(tài)進(jìn)程及不可中斷進(jìn)程的平均進(jìn)程數(shù),運(yùn)行態(tài)進(jìn)程指正在使用或者等待使用 CPU 的進(jìn)程,不可中斷進(jìn)程指正等待一些 IO 操作的進(jìn)程??墒褂?uptime 查看此指標(biāo)。

$ uptime
 16:48:09 up 2 days, 23:43,  2 users,  load average: 0.01, 0.21, 0.20
   

IP

# 公網(wǎng)IP
$ curl ifconfig.me
59.110.216.155

# 公網(wǎng)IP,上個(gè)地址的網(wǎng)絡(luò)在國(guó)內(nèi)不太好
$ curl icanhazip.com
59.110.216.155

# 私網(wǎng)IP
$ ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.17.68.39  netmask 255.255.240.0  broadcast 172.17.79.255
        ether 00:16:3e:0e:01:d8  txqueuelen 1000  (Ethernet)
        RX packets 416550  bytes 505253322 (481.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 194374  bytes 67561825 (64.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
   

登錄用戶

$ who -u
who -u
root     pts/0        Oct 18 15:04 04:25       16860 (124.200.184.74)
root     pts/2        Oct 18 18:10 01:22        2545 (124.200.184.74)
root     pts/5        Oct 18 19:33   .         24952 (124.200.184.74)

$ last -a | head -6
root     pts/5        Fri Oct 18 19:33   still logged in    124.200.184.74
root     pts/2        Fri Oct 18 18:10   still logged in    124.200.184.74
root     pts/2        Fri Oct 18 18:10 - 18:10  (00:00)     124.200.184.74
root     pts/2        Fri Oct 18 17:54 - 18:10  (00:16)     124.200.184.74
root     pts/2        Fri Oct 18 17:49 - 17:53  (00:03)     124.200.184.74
root     pts/2        Fri Oct 18 16:49 - 17:25  (00:36)     124.200.184.74

到此,相信大家對(duì)“如何查看linux和centos的基本配置”有了更深的了解,不妨來實(shí)際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI