温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

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

发布时间:2021-12-18 10:00:30 来源:亿速云 阅读:152 作者:iii 栏目:大数据

本篇内容主要讲解“如何查看linux和centos的基本配置”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“如何查看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 版本号
$ cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
     

内存配额及使用情况

查看还有多少内存,available 指还有多少可用内存

# -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 核心数量及使用率

# 查看 cpu 的核心数
$ cat /proc/cpuinfo

# 查看
$ top

$ htop
   

磁盘使用情况

$ df -h

平均负载

load average 指单位时间内运行态进程及不可中断进程的平均进程数,运行态进程指正在使用或者等待使用 CPU 的进程,不可中断进程指正等待一些 IO 操作的进程。可使用 uptime 查看此指标。

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

IP

# 公网IP
$ curl ifconfig.me
59.110.216.155

# 公网IP,上个地址的网络在国内不太好
$ curl icanhazip.com
59.110.216.155

# 私网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

到此,相信大家对“如何查看linux和centos的基本配置”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI