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
Why Using Pipe for Sort (Linux Command) Is Slow
Replace Every N'Th Occurrence in Huge Line in a Loop
Diolan Dln-2 Spi Controller on X86_64 Platform
Which Real-Time Priority Is the Highest Priority in Linux
How to Convert Iso8859-15 to Utf8
Using Awk to Align Columns in Text File
Limit on File Name Length in Bash
How to Calculate the Mean of a Column
Unix Vs Bsd Vs Tcp Vs Internet Sockets
How to Pass Command Line Parameters from a File
Bash Pass Variable as Argument with Quotes
How to Export Symbol from Linux Kernel Module in This Case
Start Jboss 7 as a Service on Linux
Remote Linux Server to Remote Linux Server Dir Copy. How
How to Fix the Rust Error "Linker 'Cc' Not Found" for Debian on Windows 10
How to Copy Multiple Files from a Different Directory Using Cp