linux查看系统版本令(如何查看linux系统版本)
简介Linux有很多发行版本,一般通过内核就可以判断大致的发行版本。但是如果需要详细的发行版本信息,就可以借助令进行查看。l_release显示LSB(Linux Standard Base)兼容的发行版本信息。如果是LSB兼容的发行版本,在/etc/l-release就可以查看到具体的版本信息。l_release可以快速过滤这些信息找到自己需要的字段,这个令有可能没有自带,可以自行安装l-release包就可以有了。l_release -hFSG l_release v1.4 prints certain LSB (Linux Standard Base) andDistribution information.Usage: l_release [OPTION]...With no OPTION specified it is the same as -v.Options:-v, --versionDisplay the version of the LSB specification against which the distribution is compliant.-i, --idDisplay the string id of the distributor.-d, --descriptionDisplay the single line text description of the distribution.-r, --releaseDisplay the release number of the distribution.-c, --codenameDisplay the codename according to the distribution release.-a, --allDisplay all of the above information.-s, --shortDisplay all of the above information in short output format.-h, --helpDisplay this message.l_release -aLSB Version: n/aDistributor ID: ManjaroLinuxDescription: Manjaro LinuxRelease: 21.0.2Codename: OrnaraVersion文件l_release这个令需要有另外安装,如果没有安装也可以通过其他的版本信息文件找到版本的信息。RHEL系列:/etc/redhat-release、/etc/os-release、/etc/system-release 等,这些文件一般都是指向同一个文件,如果是重新发行的版本,例如centos,还会有/etc/centos-releaseDebian系列:/etc/debian-version、/etc/issue等,同样重新发行的版本也会有对应的version文件。内核版本查看内核版本一般都使用uname这个令。uname -aLinux manjaro 5.11.14-1-MANJARO #1 SMP PREEMPT Wed Apr 14 08:25:29 UTC 2021 x86_64 GNU/Linux用这个令也可以快速过滤到自己需要的字段。也可以直接查看/proc/version来查看当前云中的内核版本cat /proc/versionLinux version 5.11.14-1-MANJARO (builduser@LEGION) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Wed Apr 14 08:25:29 UTC 2021