查看CentOS版本

Command Description
$ rpm -q centos-release CentOS version valid for CentOS 6 and higher. Causes to reveal major, minor and asynchronous CentOS version.
$ lsb_release -d Requires redhat-lsb package to be installed before execution.
$ rpm -E % RPM macro to reveal a major CentOS version
$ rpm --eval % RPM macro to display a major version of CentOS
$ cat /etc/centos-release Linux cat command to output content of the /etc/centos-release to query CentOS version. Works with CentOS 6 and higher.
posted @ 2021-07-01 13:38  脉望  阅读(113)  评论(0)    收藏  举报