Linux查看系统版本和内核版本[通俗易懂]

Linux查看系统版本和内核版本[通俗易懂]1.查看Linux系统版本cat/etc/issue或者cat/etc/redhat-release示例:[root@localhostgrafana]#cat/etc/issueCentOSrelease6.5(Final)Kernel\ronan\m2.查看Linu

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

目录

1.查看Linux系统版本

命令1:lsb_release -a

lsb_release解析

命令2: cat /etc/issue

命令3: cat /etc/redhat-release

2.查看Linux内核版本

命令1: uname -a

命令2: cat /proc/version

3.查看CPU个数,剩余内存,和磁盘利用

使用lscpu


​​​​​​​

1.查看Linux系统版本

命令1:lsb_release -a

该命令适用于所有Linux系统,会显示出完整的版本信息,包括Linux系统的名称,如Debian、Ubuntu、CentOS等,和对应的版本号,以及该版本的代号,例如在Debian 8中将会显示代号jessie。

[root@iZbp13nq1pxf5wki525wiuZ ~]# lsb_release -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch
Distributor ID:	CentOS
Description:	CentOS Linux release 7.9.2009 (Core)
Release:	7.9.2009
Codename:	Core

lsb_release解析

显示发行版本信息

补充说明

LSB是Linux Standard Base的缩写, lsb_release命令 用来显示LSB和特定版本的相关信息。如果使用该命令时不带参数,则默认加上-v参数。

[root ~]# lsb_release --h
FSG lsb_release v2.0 prints certain LSB (Linux Standard Base) and
Distribution information.

Usage: lsb_release [OPTION]...
With no OPTION specified defaults to -v.

Options:
  -v, --version
    Display the version of the LSB specification against which the distribution is compliant.
  -i, --id
    Display the string id of the distributor.
  -d, --description
    Display the single line text description of the distribution.
  -r, --release
    Display the release number of the distribution.
  -c, --codename
    Display the codename according to the distribution release.
  -a, --all
    Display all of the above information.
  -s, --short
    Use short output format for information requested by other options (or version if none).
  -h, --help
    Display this message.

命令2: cat /etc/issue

该命令适用于所有Linux系统,显示的版本信息较为简略,只有系统名称和对应版本号。

[root ~]# cat /etc/issue
\S
Kernel \r on an \m

命令3: cat /etc/redhat-release

该命令仅适用于Redhat系列的Linux系统,显示的版本信息也较为简略。

[root ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

2.查看Linux内核版本

命令1: uname -a

[root ~]# uname -a
Linux iZbp13nq1pxf5wki525wiuZ 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

命令2: cat /proc/version

[root@iZbp13nq1pxf5wki525wiuZ ~]# cat /proc/version
Linux version 3.10.0-1160.45.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Wed Oct 13 17:20:51 UTC 2021

3.查看CPU个数,剩余内存,和磁盘利用

# 剩余内存

[root@iZ6245lpxykZ ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          1841       1498        342         57         39        526
-/+ buffers/cache:        932        908
Swap:         1024          0       1024

# 查看CPU个数
[root@iZ6245lpxykZ ~]# cat /proc/cpuinfo| grep “processor”| wc -l
1

# 磁盘利用
[root@iZ6245lpxykZ ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        40G  8.3G   29G  23% /
devtmpfs        913M     0  913M   0% /dev
tmpfs           921M  1.3M  920M   1% /dev/shm
tmpfs           921M   57M  865M   7% /run
tmpfs           921M     0  921M   0% /sys/fs/cgroup
tmpfs           185M     0  185M   0% /run/user/0

使用lscpu

[root@iZj6c7q37rfjtps4h88ieoZ ~]# cat /proc/cpuinfo| grep "processor"| wc -l
4
[root@iZj6c7q37rfjtps4h88ieoZ ~]# lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  2
Core(s) per socket:  2
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               85
Model name:          Intel(R) Xeon(R) Platinum 8269CY CPU @ 2.50GHz
Stepping:            7
CPU MHz:             2499.998
BogoMIPS:            4999.99
Hypervisor vendor:   KVM
Virtualization type: full
L1d cache:           32K
L1i cache:           32K
L2 cache:            1024K
L3 cache:            36608K
NUMA node0 CPU(s):   0-3
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid tsc_known_freq pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves arat avx512_vnni

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/184023.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • FDD 与 TDD LTE区别

    FDD 与 TDD LTE区别虽然国内4G牌照迟迟不见发布,但私底下各大运营商和终端商早已摩拳擦掌,各网用户尤其是备受折磨的中国移动用户也都在期待4G时代的到来。放眼望去,目前在全球81个国家已有213张LTE商用网络,其中FDD-LTE商用网络192张、TD-LTE商用网络11张,而中国4G如箭在弦,被认为是一场由中国移动积极促成的产业大跃进。随着大家不断谈论4G,相关的新名词也不断涌现,包括不同制式的网

    2022年5月30日
    42
  • 音质好的linux主机,5千音质好的HIFI播放器有哪些?5款性价比“神砖”简评「建议收藏」

    本文已获得作者授权,文中言论不代表乙迷观点。作者:蓝色风暴作为HiFi发烧友,用手机听歌?呵呵,那肯定是不存在的。想要拥有好音质,手机应该是达不到要求的,毕竟手机的推力有限,不能很好发挥耳机的潜力,也就无法更高的还原音乐细节,从而让你无法感受到高解析、高保真的音乐效果,所以一款无损播放器是绝对少不了的。而当你听过高品质的音质,相信也会宠坏你的耳朵,这也是音乐发烧友耳朵挑剔的原因,所以不要跟发烧友谈…

    2022年4月16日
    96
  • Cpu流水线_cpu多级流水线

    Cpu流水线_cpu多级流水线原文地址:AJourneyThroughtheCPUPipeline转载翻译地址:CPU流水线的探秘之旅作为程序员,CPU在我们的工作中扮演了核心角色,因此了解处理器内部的工作方式对程序员来说不无裨益。CPU是如何工作的呢?一条指令执行需要多长时间?当我们讨论某个新款处理器拥有12级流水线还是18级流水线,甚至是更深的31级流水线时,这到些都意味着什么呢?应用程序通常会将CPU看

    2022年8月20日
    11
  • linux 心脏滴血漏洞,漏洞bash近日“破壳”,当心再次“心脏出血”

    linux 心脏滴血漏洞,漏洞bash近日“破壳”,当心再次“心脏出血”2014年9月24日,外媒曝出一个广泛存在于主流操作系统的漏洞bash,该漏洞会影响到Redhat、CentOS、Ubuntu、Debian、Fedora、AmazonLinux、OSX10.10等平台,预计影响范围和纵深程度都可能匹敌或者超过今年4月发现的“心脏流血”(Heartbleed)漏洞。9月25日,经过与兄弟厂商的讨论,最终决定将此此漏洞中文名命名为“破壳,并于25日一早将此…

    2022年7月16日
    25
  • 2019版idea激活码破解方法

    2019版idea激活码破解方法,https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月15日
    285
  • uniapp背景图片占不满屏幕_vue背景图片加载不出来

    uniapp背景图片占不满屏幕_vue背景图片加载不出来1.手机支持base64(小于40kb会自动转换否则就只能自己动手了2.路径前面加~@如:background:url(“~@/static/img/phb-no2@2x.jpg”);图片大于40k可以自己转化转化base64使用如:background:url(“data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAu4AAAEoCAI…

    2022年9月19日
    2

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号