How do I identify the particular Linux flavor via command line?

余生颓废 提交于 2019-11-27 10:46:45

问题


I'd like to be able to detect which particular Linux flavor is installed on a computer, e.g. Ubuntu vs Fedora, via a command line command.

Some people recommend uname -a, but that only reports the kernel version.


回答1:


Try the below command.... It worked for me...

cat /proc/version

Once you know that you are running Red Hat for example, you can get to the point with:

cat /etc/redhat-release

Or on Debian:

cat /etc/debian_version

or in general :

cat /etc/*-release

Also you could use the following command

cat /etc/issue




回答2:


For displaying details including release and codename of the distro

lsb_release -a



回答3:


I hope this works echo $(lsb_release -si)



来源:https://stackoverflow.com/questions/13036048/how-do-i-identify-the-particular-linux-flavor-via-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!