How do I determine the version of a CentOS server without access to any graphical interface? I've tried several commands:
# cat /proc/version
Linux version 2.6.18-128.el5 (mockbuild@hs20-bc1-7.build.redhat.com)
(gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)) …
# cat /etc/issue
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
but which one is correct: 4.1.2-4 from /proc/version
or 5.3 from /etc/issue
?
ls /etc/*elease
on my system gives/etc/centos-release /etc/redhat-release /etc/system-release
. So I'm guessing from all this that the release files tend to be in/etc/*-release
- but possibly with some capitalisation. – mwfearnley Aug 07 '15 at 12:35/etc/issue
has been overwritten with an MOTD or security disclaimer for use with theBanner
option insshd_config
– batfastad Oct 06 '15 at 14:20cat /etc/*os-release
should yield more targetted results for CentOS and still work on Ubuntu and others. – webaholik Apr 15 '19 at 19:59