- CATALOG -
Zhenguo Zhang's Blog
Sharing makes life better
[Tips] Get the OS version of Linux

There are many variants of Unix/Linux systems, such as Ubuntu, Redhat, and even some versions in Windows system such as MinGW/Msys and Cygwin.

Today I am going to introduce a way to get such information, which is simple, run the following command

1
uname -o

Running this command in Ubuntu and Redhat will yield GNU/Linux, while running it under MinGW/Msys yields Msys. If you run

1
uname -r

will give you kernel release.

Actually, the command uname can output more information than this, if you add the option ‘-a’, including kernel name, hostname, and processor type. Check the command’s manpage for more information.

Other methods

In addition to uname, one can also use the following command to output OS information:

1
2
3
lsb_release -a
cat /proc/version
cat /etc/os-release

Happy computing. 😄


Last modified on 2019-11-02

Comments powered by Disqus