How to Identify the Particular Linux Flavor via Command Line

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

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

how can i know on which flavour of linux i was using through command

Have you tried cat /etc/*-release ?

Other commands that might work:

cat /etc/system-release # I believe mostly Red Hat based distro

cat /proc/version

How to discover what Linux distribution is in use

lsb_release -i may work for you.

More detail is available with lsb_release -a

Some discussion at http://etbe.coker.com.au/2007/08/30/identifying-the-distribution-of-a-linux-system/

How to get Linux distribution name and version?

Try:

cat /etc/lsb-release

You can also try

lsb_release -a

Or:

cat /proc/version

How to detect the OS from a Bash script?

I think the following should work. I'm not sure about win32 though.

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# ...
elif [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OSX
elif [[ "$OSTYPE" == "cygwin" ]]; then
# POSIX compatibility layer and Linux environment emulation for Windows
elif [[ "$OSTYPE" == "msys" ]]; then
# Lightweight shell and GNU utilities compiled for Windows (part of MinGW)
elif [[ "$OSTYPE" == "win32" ]]; then
# I'm not sure this can happen.
elif [[ "$OSTYPE" == "freebsd"* ]]; then
# ...
else
# Unknown.
fi


Related Topics



Leave a reply



Submit